I'm not that versed in two phase commits (2pc) either... my understanding is that there is a "precommit" phase and a "commit" phase. The precommit tells the database that you are going to commit the transaction. If the precommit succeeds, then the database is telling you that it guarantees that the commit will succeed.
2pc is used in distributed transactions where more than one transactional resource (i.e. 2 or more databases) are participating in a global transaction, where all commits to all resources must all succeed or fail together. This is coordinated by a "transaction manager" which manages the precommit/commit/rollback protocols among the resources enlisted in the global transaction. In this scenario, the TM calls precommit on all resources, and if all succeed, then it commits each resource.
I'm trying to implement this global transaction concept in my system, where I have one or more PostgreSQL databases and possibly other transactional resources such as JMS queues. From what I understand, other databases such as Oracle amd SQL Server support 2pcs, but I haven't worked with them at that level. So my question is "How do I use PostgreSQL as a 2-phase resource?"
Clear as mud? ;-)
David,
Can you help me out here, I'm not familiar with two phase commits, why would you want to, and what would you expect the behaviour to be?
Dave
In other words, how do you tell the database to pre-commit???
How does one perform a 2-phase commit against PostgreSQL? In reading the JDBC driver code, the driver itself doesn't implement a 2pc protocol, so I'm wondering if it's even possible to do. Any thoughts?