Base solution for your next web application

Activities of "pkut"

Hi,

Yes, we querying database first, but sometimes it's not enough and insert attempt fail on database constraint. So creating inner unit of work seems to be a solution, but - as far as I remember, documentation says that inner UOW uses the same connection and other DB related stuff as outer UOW. Looks like my understanding is a bit wrong here, please explain the details of how inner UOW works and how can I be sure that we have new DbContext.

Best regards Pavel

Hi.

We did exactly as you said, injected IUnitOfWorkManager and manually started UnitOfWork. But the problem is not directly with UOW, the problem actually will be the same if you will manually work with DbContext. When you need to add new record you do:

var myNewRecord=new MyRecord {  ....fill some data....}
context.MyRecordsTable.Add(myNewRecord);
try{
    context.SaveChanges();
}
catch (...database exception to handle failure....)
{
    //Catching unique constraint failure
}

When you fail on saving changes the myNewRecord will still be in the context and if you need to add another items to the database, you have to remove it someway - recreate DbContext or detach myNewRecord from context.

Now in AspNetBoilerplate actual DbContext is hidden, so how should I resolve the same situation ?

Answer

Unfortunately I've Azure logs that when checking the problem. So for now I've turned on all logging that possible and waiting for the next case. Thank you for help.

Best regards Pavel.

Answer

Hi,

We have no external cache like Redis. As far as I understand nothing was customized to change scripts generation process or change user permissions processing..

Best regards Pavel

Hello,

Sorry for bothering you, but we solved the problem. Actually we have changed database initializer when trying to deploy to Azure and this was very critical for unit tests. Setting up default initializer in the unit test project solves the problem. Thank you very much for so interesting framework.

Best regards

Showing 1 to 5 of 5 entries