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 2PC to maintain the transaction integrity.
If you are only accessing two databases, you only need 2PC support on one of them. The protocol would be something like this: 1. Prepare the transaction for 2PC on the first connection. 2. If the transaction could not be prepared, rollback both connection. 3. If the transaction could be prepared, commit the second connection. 4. If the second connection committed successfully, complete the transaction on the first connection 5. If the second connection failed to commit, rollback the prepared transaction on the second connection. 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. James. _______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig