Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

isolation level issues #2215


User avatar
0
epgeroy created

I need to secure some transactions cause I been having some duplicated entries.

the logic goes like

  1. is there some products
  2. get them!
  3. write on database that you got it (in another table) and wait for authorization (another use case)

I have understood that what I need is some database locks, also that with isolation level serialize each transaction starts to read when the prev transaction finishes writing.

  1. I used
using (
    var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions
        {IsolationLevel = IsolationLevel.Serializable}, TransactionScopeAsyncFlowOption.Enabled))
        {
            ...
            scope.Complete();
       }

did'n work, still producing duplicated entry's

  1. I tried
Configuration.UnitOfWork.IsolationLevel = IsolationLevel.Serializable;

at the preinitializer on the Core module. Also did not work

this, among many non useful hacks that I found on internet

please, any help will be very appreciated. Thanks in advance


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Did you tried unit of work for this ? <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Unit-Of-Work">http://aspnetboilerplate.com/Pages/Docu ... it-Of-Work</a>