transactions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Chan

    transactions

    hello guys, need help, i;m a bit confused about transactions after
    reading some articles about locking/snapshot


    let's stay i have this scenario


    -----------------------------------------------------------------------------------
    begin Tran 1 |
    select Max Id = 5 |
    set @a = MaxId + 1 = 6 |
    insert into t values(@a) |
    -----------------------------------------------------------------------------------
    | begin Tran 2
    | select max Id = XX
    | set @a = maxId + 1 = ?
    | insert and commit tran
    2
    -------------------------------------------------------------------------------------
    commit tran 1 |
    ------------------------------------------------------------------------------------

    what will XX be ? I thought transactions run in queues, but i saw
    illustrations like the above

Working...