[Zope-DB] TPC for ZOracleDA

Chris Withers chris at simplistix.co.uk
Mon Nov 3 18:12:54 EST 2003


Matthew T. Kromer wrote:

> Having said that, if you want to monkey with the DA code a little bit, 

Well, I'm monkeying a lot now, so would be good to do this...

> there IS support for two-phase commit in DCOracle2, just not in 
> ZOracleDA.  What you'll need to do is catch the tpc_vote call and then 
> do a connection.prepare(),

so, something akin to:

def tpc_vote(self,*ignored):
    TM.tpc_vote()
    connection.prepare()

right?

> and then I think you also need to change the 
> connection.commit() to connection.commit(twophase=1) [n.b. I'm not sure 
> if you don't have to commit twice, once with twophase=1 and once without].

How can I find out what code needs to be called in tpc_finish()?

> The tpc_vote phase is allowed to raise an error, and the 
> connection.prepare() should see that the connection to Oracle is down 
> just like the commit/rollback sees.

Cool...

Chris




More information about the Zope-DB mailing list