[ZODB-Dev] [Ann] "ReadCommitted" transaction isolation level

Casey Duncan casey@zope.com
Tue, 25 Mar 2003 14:56:54 -0500


On Tuesday 25 March 2003 02:17 pm, Steve Alexander wrote:
>=20
> Thinking about this some more, if we carefully define "search condition=
"=20
> and "query" to be in the scope of particular classes of object, then it=
=20
> should be feasible to prevent phantom reads in just those cases.
> For example, a BTree object could be "locked" during a transaction that=
=20
> reads it, so that writes by other transactions are *entirely* forbidden=
=2E=20
> It could also be locked in a more selective way, so that if the reading=
=20
> transaction is interested in the set of BTree items where the key is=20
> between 200 and 400, the BTree would be 'guarded' against inserts,=20
> deletions and modifications of data where the key is between 200 and 40=
0.
>=20
> --
> Steve Alexander

Other databases have a "select for update" facility that provides this=20
isolation. We have discussed the possibility of implementing this type of=
=20
facility in the ZODB or in specific objects like BTrees.=20

I would imagine that for certain applications it would be very useful to =
have=20
this sort of read for update locking. I'll defer to the database experts =
on=20
what the "right way" is, but it seems to me that it would not be too=20
difficult to implement a very specific implementation of this as a start.

-Casey