[ZODB-Dev] transacting multiple databases
hazmat
hazmat@objectrealms.net
Mon, 9 Dec 2002 17:48:16 -0800
On Tuesday 10 December 2002 04:13 am, Christian Reis wrote:
> On Mon, Dec 09, 2002 at 03:26:53PM -0800, hazmat wrote:
> > On Monday 09 December 2002 07:00 pm, David McCusker wrote:
> > > You can consider this a question about what get_transaction() means if
> > > you like.
> > >
> > > Suppose I open three databases, get connections to all three, and make
> > > changes in all three databases, and then attempt to commit all of them
> > > at once:
> > >
> > > get_transaction().commit()
> > >
> > > What happens?
> > >
> > > Are all three databases committed?
> >
> > yes
>
> Note that if you want separate transactions per connection, Shane posted
> a CVS branch last week that works like a charm. I've been testing on it
> a bit and will move my code over soon.
very cool! i browsed through the email and the source looks good. one comment
on mounted storage stuff quoted below
jh wrote
> How do we deal with transactions involving multiple connections?
> Perhaps I misunderstand mounted storages, but don't they involve
> several independent jars that are coordinated by registering with the
> same transaction. Don't we see the same problem if a transaction
> involves, for example, a ZODB connection and a database adapter?
sh responded
Mounting is Zope-specific. Zope does not use the new policy, so
mounting doesn't interact with this.
Someday we'll enable inter-database references, at which time we may
have to figure out how to ensure the transactions span all involved
connections.
--- end quote
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.
cheers,
-kapil