[ZODB-Dev] transacting multiple databases

Shane Hathaway shane@zope.com
Tue, 10 Dec 2002 09:51:46 -0500


hazmat wrote:
> i thought mounted storage were a zodb feature not a zope one? (at least 
> infrastructure code for them is in the ZODB package). a thought related to 
> allowing mounted storages to participate in local txn. when the mounted 
> storage is opened/traversed (in a getattr sense) it can register a 
> MountedLogicalTxn with the parent connection transaction. the mounted txn can  
> act in effect as a local transaction to the mounted storage. it will proxy 
> txn messages from the parent txn to its registrants.

It's not really a ZODB feature, since it relies on a feature of 
ExtensionClass that ZODB does not use: __of__().  I put Mount.py in the 
ZODB package because I also thought at first that it was a ZODB feature. :-)

It will be easy to get everything working together with mounting, 
though.  In addition to the setLocalTransaction() method, we might have 
a setTransaction() method which lets the mounting machinery put both 
connections in the same transaction.  Or perhaps we could make 
connections aware of when they are mounted and pull the transaction from 
their parent automatically.  Hmm, for better encapsulation, the second 
option seems best, since right now we're stuffing an extra attribute in 
the mounted connection anyway.

I think the next step is to decide whether the setLocalTransaction() 
code ought to be merged into mainline ZODB.  I'd be happy to do it with 
Jeremy's approval.  (Jeremy, are you reading?)

Shane