Slide 25
Slide 25 text
25
Rbob
Rjoe
C
BeginTransaction()
bobBal = Read(Bob, bal)
Write(Bob, bal, bobBal-$7)
joeBal = Read(Joe, bal)
Write(Joe, bal, joeBal+$7)
Commit()
State of Transaction
Writes =
[(Bob, bal, $3),
(Joe, bal, $9)]
Locks[Bob] =
(PREWRITTEN, 6, 4, [Joe])
Locks[Joe] = (STABLE, 3)
Prewrite Bob’s new balance to Bob’s row. Row
became prewritten state, so Haeinsa prevents any
other transaction’s access to the row.
Remember: checkAndPut is atomic and ensures that
value of the row has not been modified since read.
<< prewritten >>
Copyright 2013 VCNC Inc. All rights reserved