[ZODB-Dev] transacting multiple databases

hazmat hazmat@objectrealms.net
Mon, 9 Dec 2002 15:26:53 -0800


answers below from a zodb3 perspective...

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

> Are all three commits atomic?

yes

>  In the sense that none of the three
> transactions take unless all of them do completetly?

yup. its all one transaction from a high level pov. 

the default transaction manager is thread global and handles all txn 
registered objects (including those from multiple dbs).

 i vaguely remember jim mentioning some change to semantics of how this works 
in zodb3.5 (zope3) /4. such that persistent objects don't call a global 
get_transaction, but i don't recall the details, someone more familiar with 
the changes there should hopefully respond (hint :-).

-kapil