[Zope-DB] Re: TPC for ZOracleDA
Matthew T. Kromer
matt at zope.com
Wed Nov 5 10:48:54 EST 2003
Chris Withers wrote:
> 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()?
>
Try it and see if it works... :) I think you only need
connection.commit(twophase=1)
If your data dissapears, you need both.
>> 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
>
--
Matt Kromer
Zope Corporation http://www.zope.com/
More information about the Zope-DB
mailing list