Re: Two Phase commits

From: "David Hooker" <dhooker(at)a4networks(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>, "'Dave Cramer'" <Dave(at)micro-automation(dot)net>
Subject: Re: Two Phase commits
Date: 2002-03-25 20:20:37
Message-ID: 001f01c1d43a$86ea0580$6901a8c0@DHOOKER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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? ;-)

-----Original Message-----
From: Dave Cramer [mailto:Dave(at)micro-automation(dot)net]
Sent: Monday, March 25, 2002 1:55 PM
To: 'David Hooker'; pgsql-jdbc(at)postgresql(dot)org
Subject: RE: [JDBC] Two Phase commits

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

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of David Hooker
Sent: Monday, March 25, 2002 1:40 PM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Two Phase commits

In other words, how do you tell the database to pre-commit???

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of David Hooker
Sent: Sunday, March 24, 2002 1:33 AM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] Two Phase commits

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?

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-03-25 20:41:27 Re: Two Phase commits
Previous Message Dave Cramer 2002-03-25 19:55:20 Re: Two Phase commits