pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC XA Support and Sample code?
7+ messages / 4 participants
[nested] [flat]

* JDBC XA Support and Sample code?
@ 2007-12-05 20:56  Jignesh K. Shah <J.K.Shah@Sun.COM>
  0 siblings, 2 replies; 7+ messages in thread

From: Jignesh K. Shah @ 2007-12-05 20:56 UTC (permalink / raw)
  To: pgsql-jdbc

Hello All,

I am new to the XA world of PostgreSQL. What's the story of XA in 
PostgreSQL JDBC Driver? Also are there examples on how to use the 
"Experimental" XA driver in postgresql-jdbc?

Thanks.
Regards,
Jignesh




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: JDBC XA Support and Sample code?
@ 2007-12-05 22:07  Kris Jurka <books@ejurka.com>
  parent: Jignesh K. Shah <J.K.Shah@Sun.COM>
  1 sibling, 1 reply; 7+ messages in thread

From: Kris Jurka @ 2007-12-05 22:07 UTC (permalink / raw)
  To: Jignesh K. Shah <J.K.Shah@Sun.COM>; +Cc: pgsql-jdbc



On Wed, 5 Dec 2007, Jignesh K. Shah wrote:

> I am new to the XA world of PostgreSQL. What's the story of XA in PostgreSQL 
> JDBC Driver? Also are there examples on how to use the "Experimental" XA 
> driver in postgresql-jdbc?
>

PG's XA support is not expiremental, it's been part of the driver since 
the 8.1 release.  How it's used depends a lot on who/what is managing your 
transactions, so it's not real straightforward to put together concrete 
examples and configurations.  The JDBC driver's testsuite 
(org.postgresql.test.xa) manually issues xa transaction commands, so it's 
the most clear use of XA, but not really representative of actual usage.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: JDBC XA Support and Sample code?
@ 2007-12-05 22:18  Jignesh K. Shah <J.K.Shah@Sun.COM>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Jignesh K. Shah @ 2007-12-05 22:18 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

So how come the API documentation for it is in privateapi and not 
publicapi.. That prompted me to infer that it is experimental. (I may 
not be alone in drawing that inference from it.)

Thanks for pointer to the testsuite I will take a look at it.

-Jignesh


Kris Jurka wrote:
>
>
> On Wed, 5 Dec 2007, Jignesh K. Shah wrote:
>
>> I am new to the XA world of PostgreSQL. What's the story of XA in 
>> PostgreSQL JDBC Driver? Also are there examples on how to use the 
>> "Experimental" XA driver in postgresql-jdbc?
>>
>
> PG's XA support is not expiremental, it's been part of the driver 
> since the 8.1 release.  How it's used depends a lot on who/what is 
> managing your transactions, so it's not real straightforward to put 
> together concrete examples and configurations.  The JDBC driver's 
> testsuite (org.postgresql.test.xa) manually issues xa transaction 
> commands, so it's the most clear use of XA, but not really 
> representative of actual usage.
>
> Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: JDBC XA Support and Sample code?
@ 2007-12-05 22:31  Kris Jurka <books@ejurka.com>
  parent: Jignesh K. Shah <J.K.Shah@Sun.COM>
  1 sibling, 0 replies; 7+ messages in thread

From: Kris Jurka @ 2007-12-05 22:31 UTC (permalink / raw)
  To: Jignesh K. Shah <J.K.Shah@Sun.COM>; +Cc: pgsql-jdbc



On Wed, 5 Dec 2007, Jignesh K. Shah wrote:

> So how come the API documentation for it is in privateapi and not publicapi.. 
> That prompted me to infer that it is experimental. (I may not be alone in 
> drawing that inference from it.)

The driver just implements the standard interfaces in J2SE, so there's 
nothing that really needs to be exposed from an API standpoint. 
PGXADataSource should be moved to the public API, but it's unlikely for 
people to call it directly.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: JDBC XA Support and Sample code?
@ 2007-12-06 17:55  Heikki Linnakangas <heikki@enterprisedb.com>
  parent: Jignesh K. Shah <J.K.Shah@Sun.COM>
  1 sibling, 1 reply; 7+ messages in thread

From: Heikki Linnakangas @ 2007-12-06 17:55 UTC (permalink / raw)
  To: Jignesh K. Shah <J.K.Shah@Sun.COM>; +Cc: pgsql-jdbc

Jignesh K. Shah wrote:
> I am new to the XA world of PostgreSQL. What's the story of XA in 
> PostgreSQL JDBC Driver? Also are there examples on how to use the 
> "Experimental" XA driver in postgresql-jdbc?

As Kris pointed out, it's not experimental.

It's typically used together with an application server that also acts 
as the transaction manager, and manages the connections and transactions 
for you. In that case, you don't need to do anything special; if you use 
two database connections or other resource managers in a transaction, 
the application server will perform two-phase commit using the XA driver 
behind the scenes.

The tricky part is configuring the application server/transaction 
manager to use the XA-enabled PGXADataSource. That's different on each 
product. It would be nice to get a sample config file and tutorial on 
Glassfish, hint hint ;-)

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: JDBC XA Support and Sample code?
@ 2007-12-06 18:08  Garber, Mikhail <mgarber@amazon.com>
  parent: Heikki Linnakangas <heikki@enterprisedb.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Garber, Mikhail @ 2007-12-06 18:08 UTC (permalink / raw)
  To: Jignesh K. Shah <J.K.Shah@Sun.COM>; +Cc: pgsql-jdbc


> It's typically used together with an application server that
> also acts as the transaction manager, and manages the
> connections and transactions for you. In that case, you don't
> need to do anything special; if you use two database
> connections or other resource managers in a transaction, the
> application server will perform two-phase commit using the XA
> driver behind the scenes.



Just FYI, I used Postgres XA driver against two databases using Spring and BTM transaction manager. My configuration was based on what is in BTM documentation. It worked just fine. I was not able to "break" it.


> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Heikki
> Linnakangas
> Sent: Thursday, December 06, 2007 9:55 AM
> To: Jignesh K. Shah
> Cc: pgsql-jdbc@postgresql.org
> Subject: Re: [JDBC] JDBC XA Support and Sample code?
>
> Jignesh K. Shah wrote:
> > I am new to the XA world of PostgreSQL. What's the story of XA in
> > PostgreSQL JDBC Driver? Also are there examples on how to use the
> > "Experimental" XA driver in postgresql-jdbc?
>
> As Kris pointed out, it's not experimental.
>
> It's typically used together with an application server that
> also acts as the transaction manager, and manages the
> connections and transactions for you. In that case, you don't
> need to do anything special; if you use two database
> connections or other resource managers in a transaction, the
> application server will perform two-phase commit using the XA
> driver behind the scenes.
>
> The tricky part is configuring the application
> server/transaction manager to use the XA-enabled
> PGXADataSource. That's different on each product. It would be
> nice to get a sample config file and tutorial on Glassfish,
> hint hint ;-)
>
> --
>    Heikki Linnakangas
>    EnterpriseDB   http://www.enterprisedb.com
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org
> so that your
>        message can get through to the mailing list cleanly
>



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: JDBC XA Support and Sample code?
@ 2008-02-19 05:33  Kris Jurka <books@ejurka.com>
  parent: Jignesh K. Shah <J.K.Shah@Sun.COM>
  1 sibling, 0 replies; 7+ messages in thread

From: Kris Jurka @ 2008-02-19 05:33 UTC (permalink / raw)
  To: Jignesh K. Shah <J.K.Shah@Sun.COM>; +Cc: pgsql-jdbc



On Wed, 5 Dec 2007, Jignesh K. Shah wrote:

> So how come the API documentation for it is in privateapi and not publicapi.. 
> That prompted me to infer that it is experimental. (I may not be alone in 
> drawing that inference from it.)
>

OK, I've moved PGXADataSource to the public API.  Will be in the next site 
build.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2008-02-19 05:33 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-12-05 20:56 JDBC XA Support and Sample code? Jignesh K. Shah <J.K.Shah@Sun.COM>
2007-12-05 22:07 ` Kris Jurka <books@ejurka.com>
2007-12-05 22:18   ` Jignesh K. Shah <J.K.Shah@Sun.COM>
2007-12-05 22:31     ` Kris Jurka <books@ejurka.com>
2008-02-19 05:33     ` Kris Jurka <books@ejurka.com>
2007-12-06 17:55 ` Heikki Linnakangas <heikki@enterprisedb.com>
2007-12-06 18:08   ` Garber, Mikhail <mgarber@amazon.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox