Re: Two Phase commits

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'David Hooker'" <dhooker(at)a4networks(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Two Phase commits
Date: 2002-03-25 20:41:27
Message-ID: 03a401c1d43d$6f8cda40$807ba8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

from the hackers list

http://archives.postgresql.org/pgsql-hackers/2001-07/msg00811.php

Dave

-----Original Message-----
From: David Hooker [mailto:dhooker(at)a4networks(dot)com]
Sent: Monday, March 25, 2002 3:21 PM
To: pgsql-jdbc(at)postgresql(dot)org; 'Dave Cramer'
Subject: RE: [JDBC] Two Phase commits

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

Browse pgsql-jdbc by date

  From Date Subject
Next Message mailing-list 2002-03-25 20:44:08 Re: BigDecimal Bugs
Previous Message David Hooker 2002-03-25 20:20:37 Re: Two Phase commits