[ZODB-Dev] snapshot isolation how-to

Shane Hathaway shane at zope.com
Wed Apr 16 14:19:32 EDT 2003


Adam Groszer wrote:
> Dear Shane, Jeremy,
> 
> what about the solution I proposed in "[ZODB-Dev] proposal about
> setLocalTransaction"?
> This way you don't have to change the DB.open, but you can still have a
> default local transaction with subclassing or
> ZODB.Connection.Connection._local_trans_mode=1.

If you're willing to subclass Connection, you can just override __init__ 
or _setDB() to get a local transaction.  If you're not willing to 
subclass Connection, setting _local_trans_mode seems equivalent to 
setLocalTransaction().  So _local_trans_mode seems to add nothing, but I 
might be missing something.

Shane


> -----Original Message-----
> 
> Here's another possible way to do this.  Maybe the DB.open() method
> should accept an optional "local_transactions" boolean argument.  That
> way, there's no chance to switch modes too late, and the connection will
> never wind up in multiple transactions (hopefully.)
> 
> Shane





More information about the ZODB-Dev mailing list