[rucksack-devel] Transactions: abort early?
Nikodemus Siivola
nikodemus at random-state.net
Mon May 22 05:56:49 UTC 2006
"Arthur Lemmens" <alemmens at xs4all.nl> writes:
> This may sound strange coming from me, but for prevalent objects I'd
> seriously consider using two-phase locking (acquire a lock for each object
> when you access it and release all locks at the end of the transaction).
>> Transaction T1 starts.
>> T1 does stuff, but doesn't read or write object O.
>> Transaction T2 starts.
>> T2 touches O.
>> T2 commits.
>> T1 reads 0.
>> Option 1b:
>>
>> * We no longer have access to O that matches the rest of the T1.
>> Abort T1 immediately.
If I understand correctly two-phase locking comes down to this,
actually. At the time when T1 reads O it has been changed by a younger
transaction, and no longer matches the rest of T1.
(Assuming serializable transactions are the goal.)
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."
More information about the rucksack-devel
mailing list