[ZODB-Dev] snapshot isolation how-to

Adam Groszer adamg@mailbox.hu
Tue, 15 Apr 2003 09:20:53 +0200


Dear Dieter,

In the meantime I managed somehow with 3.2a1 to get it working.
I'm using the FileStorage.

I found the following (bug?):
 I had to modify Connection._getStateAt
 was:
  raise ReadConflictError(oid=oid, serials=(T.getStartSerial(),serial,))
 to:
  raise ConflictError(oid=oid, serials=(T.getStartSerial(),serial,))
because ReadConflictError does not have an oid parameter. I did this to just
get it working. I suppose ReadConflictError should be raised instead, but I
don't know how to get an object reference in the _getStateAt method.

Another thing what I found is:
The new setLocalTransaction mode of the Connection caused that the
Transaction was never destroyed. This caused that as soon as I closed and
opened a Connection the same Transaction was used. Thus Transaction.__init__
and ._setup was never called again, but when (re)starting the server.
Currently I modified the Connection.close to kill the Transaction, but maybe
it would be a better idea to reset the Transaction._startSerial at a
finished transaction.

After the above modifications (as I remember) it's working fine.

I think about the setLocalTransaction I will make a proposal to the List.

Adam

-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Monday, 2003 April 14. 8:29 PM
To: Adam Groszer
Cc: zodb-dev@zope.org
Subject: Re: [ZODB-Dev] snapshot isolation how-to


Adam Groszer wrote at 2003-4-14 14:29 +0200:
 > I'd like to ask, how-to use the snapshot (or ReadCommitted) isolation
level
 > with ZODB.
 > I already downloaded the patch
 > http://www.dieter.handshake.de/pyprojects/zope/ReadCommitted.pat
 > tried it with 3.1, 3.2a1, read the "[Ann] "ReadCommitted" transaction
 > isolation level" and "Re: [Zope-dev] Conflict reduced BTrees for
catalogin"
 > threads but am still confused.
 > My current problem is that I still get (read)ConflictErrors on
OOBucket's.

Try to get a traceback for this "ReadConflictError" such that
we can see where the exception is raised.

The patch can prevent read conflict errors only for storages
with history support. Currently, it will not prevent
"ReadConflictError"s for other storages.


Dieter