help! concurrency problem

  • I have 2 transactions running with concurrency problem:

    Transaction T1:

      1) set transaction isolation level @isolationLevel

      2) begin transaction

      3) select * from vendor

         ----wait 1----

      4) update companyInfo set AddrL1='stree 1'

         ----wait 2----

      5) rollback

    Transaction T2:

      1) set transaction isolation level @isolationLevel

      2) begin transaction

      3) select * from companyInfo

         ----wait 1----

      4) update vendor set name='vendor 1' where code = '021009'

         ----wait 2----

      5) rollback

    situation 1 :  @isolationLevel =  read committed

     I run T1 to wait2, then i try to run T2,the T2.step3 is blocked.

    situation 2 :  @isolationLeve2 =  repeatable read OR serializable

     I run both T1 and T2 to wait1. after that, I try to run both T1 and T2 to wait2,but they deadlocked

     

    I do not want the read/write block write/read,how can I implement that ? ( i do not want set  read UNcommitted )

    How can I set the default Pessimistic concurrency to Optimistic ?

    thanks in advance

  • You can set the DEADLOCK_PRIORITY to LOW for T1 so that it does not block T2.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply