[ZODB-Dev] snapshot isolation how-to

Dieter Maurer dieter@handshake.de
Tue, 15 Apr 2003 21:14:28 +0200


Adam Groszer wrote at 2003-4-15 09:20 +0200:
 > 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.

This was indeed a bug in the first version.

Meanwhile, you can download the second version that fixes this bug
and another one.

 > 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.

That's interesting:

  "setLocalTransaction" is something I do not yet know.

  Probably, I must make a comment that the patch was tested only
  with the ZODB version distributed with Zope 2.6.1.

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

Thank you for your feedback!



Dieter