Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread Dieter Maurer
M.-A. Lemburg wrote at 2008-1-18 12:29 +0100: > ... >While this would seem desirable, it is not how the Zope TM >works. > >Phase 1 is implemented by doing a vote on the success >of the transaction. Phase 2 then finishes or aborts the transaction >depending on the vote. > >If something fails in phas

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread James Henstridge
On 18/01/2008, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > If that has more than just 'prepare_transaction', 'commit_transaction' and > > 'rollback_transaction' it has no place in the DB-API IMO. These three > > actions are the entirety of what PostgreSQL provides and are the building > > blocks y

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread James Henstridge
On 18/01/2008, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > Looking at the IDataManager API, it looks like it looks like the > > correct way to implement two phase commit would be: > > > > 1. if tpc_begin() is called, note that two-phase commit is being used. > > 2. in commit(), simply prepare the

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread M.-A. Lemburg
On 2008-01-18 14:20, Stuart Bishop wrote: > M.-A. Lemburg wrote: > >> Now, if a database provides such an XA interface, this could >> also be made available to a Python TM. You'd then have to >> open the connection via this XA interface rather than the >> standard connection constructor (or pass i

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread Stuart Bishop
M.-A. Lemburg wrote: > Now, if a database provides such an XA interface, this could > also be made available to a Python TM. You'd then have to > open the connection via this XA interface rather than the > standard connection constructor (or pass in a parameter > to this constructor to make it use

Re: [DB-SIG] Need help regarding XA Compliant 2PC protocol

2008-01-18 Thread Stuart Bishop
James Henstridge wrote: > The patch I did for psycopg2 should let you perform 2PC, so could be > used as above whether or not the Oracle adapter you are using supports > it. You can also do this right now if you don't mind it being ugly: con = psycopg.connect('') [... do stuff ...] xid = 'xid%f'

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread Stuart Bishop
James Henstridge wrote: > So is there any recommendations for what a two-phase commit API should > look like? Here are the three obvious possibilities. The first is what you already have. The other two also allow access to all of PostgreSQL's two phase commit API and are functionally identical. A

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread M.-A. Lemburg
On 2008-01-18 13:05, James Henstridge wrote: > On 18/01/2008, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> While this would seem desirable, it is not how the Zope TM >> works. >> >> Phase 1 is implemented by doing a vote on the success >> of the transaction. Phase 2 then finishes or aborts the trans

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread M.-A. Lemburg
On 2008-01-18 12:29, James Henstridge wrote: > On 18/01/2008, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> On 2008-01-18 09:37, James Henstridge wrote: >>> Hello, >>> >>> I've been looking at implementing two phase commit for the psycopg2 >>> driver for PostgreSQL. It was suggested that I bring up

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread James Henstridge
On 18/01/2008, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > While this would seem desirable, it is not how the Zope TM > works. > > Phase 1 is implemented by doing a vote on the success > of the transaction. Phase 2 then finishes or aborts the transaction > depending on the vote. > > If something fai

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread M.-A. Lemburg
On 2008-01-18 11:40, Jeff Rush wrote: > M.-A. Lemburg wrote: >> On 2008-01-18 09:37, James Henstridge wrote: >>> I've been looking at implementing two phase commit for the psycopg2 >>> driver for PostgreSQL. It was suggested that I bring up the issue on >>> this list to see if there were any sugge

Re: [DB-SIG] Need help regarding XA Compliant 2PC protocol

2008-01-18 Thread James Henstridge
On 18/01/2008, Nand Rathi <[EMAIL PROTECTED]> wrote: > Hello All > > Greetings > > I see a current thread regarding 2PC protocol, but my > requirement is little different. > > I need to write some python programs which will access > 2 databases simultaneously (Oracle & Postgresql). I > need to use

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread James Henstridge
On 18/01/2008, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > On 2008-01-18 09:37, James Henstridge wrote: > > Hello, > > > > I've been looking at implementing two phase commit for the psycopg2 > > driver for PostgreSQL. It was suggested that I bring up the issue on > > this list to see if there were

[DB-SIG] Need help regarding XA Compliant 2PC protocol

2008-01-18 Thread Nand Rathi
Hello All Greetings I see a current thread regarding 2PC protocol, but my requirement is little different. I need to write some python programs which will access 2 databases simultaneously (Oracle & Postgresql). I need to use 2PC to maintain the transaction integrity. Is there a python module a

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread Jeff Rush
M.-A. Lemburg wrote: > On 2008-01-18 09:37, James Henstridge wrote: >> >> I've been looking at implementing two phase commit for the psycopg2 >> driver for PostgreSQL. It was suggested that I bring up the issue on >> this list to see if there were any suggestions about what form the API >> should

Re: [DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread M.-A. Lemburg
On 2008-01-18 09:37, James Henstridge wrote: > Hello, > > I've been looking at implementing two phase commit for the psycopg2 > driver for PostgreSQL. It was suggested that I bring up the issue on > this list to see if there were any suggestions about what form the API > should take. > > The API

[DB-SIG] Any standard for two phase commit APIs?

2008-01-18 Thread James Henstridge
Hello, I've been looking at implementing two phase commit for the psycopg2 driver for PostgreSQL. It was suggested that I bring up the issue on this list to see if there were any suggestions about what form the API should take. The API from the initial patch I produced stuck pretty close to the