pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
FAQ update about transaction interleaving
4+ messages / 3 participants
[nested] [flat]

* FAQ update about transaction interleaving
@ 2006-09-29 15:34  Heikki Linnakangas <heikki@enterprisedb.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Heikki Linnakangas @ 2006-09-29 15:34 UTC (permalink / raw)
  To: pgsql-jdbc

Our FAQ entry on XA support is quite vague; most users don't know what 
transaction interleaving is or why they should care.

Here's an updated version based on a response I gave earlier to a post 
asking about it:

-----------------
1.1. Does the driver have XA support?

Yes, starting with the 8.1dev-403 driver. However, the transaction 
interleaving is not supported.

1.2. What is "transaction interleaving"?

Transaction interleaving means that one database connection can be used 
for multiple transactions at the same time, switching between the 
transactions.

Transaction interleaving is mostly useless, but it's a required part of 
the JTA specification. Some application servers use it to allow a bit 
more concurrency without allocating a bigger jdbc connection pool.

Few JDBC drivers support transaction interleaving properly. Some fake it 
by issuing early prepare commands, risking transaction integrity, some 
give strange error messages, some fail in other, subtle ways. The 
PostgreSQL JDBC driver does it's best to detect interleaving and throws 
a proper error message when it can't do what's requested.

Because of the lack of driver support, all of the popular application 
servers use provide options to work around it, or don't use it at all. 
Therefore, lack of transaction interleaving shouldn't affect your 
application or data integrity.

See the JTA specification, section 3.4.4, or search the pgsql-jdbc 
mailing list archives for more information.
 
1.3. How to configure application server XXX to work with the PostgreSQL 
JDBC driver

[We need some examples...]

Please read the documentation of your application server for details. 
You might need to set a flag to disable transaction interleaving. In 
JBoss, for example, set the "track-connection-by-tx" parameter.

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




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

* Re: FAQ update about transaction interleaving
@ 2006-09-29 21:39  Mikael Carneholm <Mikael.Carneholm@WirelessCar.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Mikael Carneholm @ 2006-09-29 21:39 UTC (permalink / raw)
  To: Heikki Linnakangas <heikki@enterprisedb.com>; pgsql-jdbc

> 1.3. How to configure application server XXX to work with the
PostgreSQL JDBC driver

> [We need some examples...]

Here's a PG XA datasource config for a JBoss app (figured out the
xa-datasource-property names by looking at the source code of the
driver):

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <xa-datasource>
    <jndi-name>AppFooXADS</jndi-name>
    <track-connection-by-tx/>
    <isSameRM-override-value>false</isSameRM-override-value>
 
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-cla
ss>
    <xa-datasource-property
name="ServerName">postgres.host</xa-datasource-property>
    <xa-datasource-property
name="DatabaseName">applications</xa-datasource-property>
    <xa-datasource-property
name="User">appFooUser1</xa-datasource-property>
    <xa-datasource-property
name="Password">secret</xa-datasource-property>
    <xa-datasource-property
name="PortNumber">5432</xa-datasource-property>
    <min-pool-size>20</min-pool-size>
    <max-pool-size>100</max-pool-size>
    <blocking-timeout-millis>60000</blocking-timeout-millis>
  </xa-datasource>
</datasources>

/Mikael




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

* FAQ update about transaction interleaving
@ 2007-04-17 11:15  Heikki Linnakangas <heikki@enterprisedb.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Heikki Linnakangas @ 2007-04-17 11:15 UTC (permalink / raw)
  To: pgsql-jdbc

I posted this FAQ patch already in November, but got no reaction...

Could we please have the FAQ updated to give more information on the 
missing support for transaction interleaving in the XA driver? The 
current wording leaves the reader wondering what the heck it is and why 
should they care. People ask about it on the list every now and then.

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

Attachments:

xa-faq-update.diff (text/plain, 2.3K) download ? xa-faq-update.diff Index: src/documentation/content/xdocs/documentation/faq.xml =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/www/src/documentation/content/xdocs/documentation/faq.xml,v retrieving revision 1.3 diff -c -r1.3 faq.xml *** src/documentation/content/xdocs/documentation/faq.xml 26 Sep 2006 05:14:10 -0000 1.3 --- src/documentation/content/xdocs/documentation/faq.xml 10 Nov 2006 16:23:38 -0000 *************** *** 10,18 **** <question>Does the driver have XA support?</question> <answer> <p> ! Yes, starting with the 8.1dev-403 driver XADataSource support ! is available. It is not complete in that it does not support ! transaction interleaving. </p> </answer> </faq> --- 10,49 ---- <question>Does the driver have XA support?</question> <answer> <p> ! Yes, starting with the 8.1dev-403 driver. However, transaction ! interleaving is not supported. ! </p> ! </answer> ! <question>What is "transaction interleaving"?</question> ! <answer> ! <p> ! Transaction interleaving means that one database connection can be ! used for multiple transactions at the same time, switching between ! the transactions. ! </p> ! <p> ! Transaction interleaving is mostly useless, but it's a required part ! of the JTA specification. Some application servers use it to allow a ! bit more concurrency without allocating a bigger jdbc connection ! pool. ! </p> ! <p> ! Few JDBC drivers support transaction interleaving properly. Some ! fake it by issuing early prepare commands, risking transaction ! integrity, some give strange error messages, some fail in other, ! subtle ways. The PostgreSQL JDBC driver does it's best to detect ! interleaving and throws a proper error message when it can't do ! what's requested. ! </p> ! <p> ! Because of the lack of driver support, all of the popular application ! servers provide options to work around it, or don't use it at all. ! Therefore, lack of transaction interleaving shouldn't affect your ! application or data integrity. ! </p> ! <p> ! See the JTA specification, section 3.4.4, or search the pgsql-jdbc ! mailing list archives for more information. </p> </answer> </faq>
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: FAQ update about transaction interleaving
@ 2007-04-20 02:18  Kris Jurka <books@ejurka.com>
  parent: Heikki Linnakangas <heikki@enterprisedb.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Kris Jurka @ 2007-04-20 02:18 UTC (permalink / raw)
  To: Heikki Linnakangas <heikki@enterprisedb.com>; +Cc: pgsql-jdbc



On Tue, 17 Apr 2007, Heikki Linnakangas wrote:

> I posted this FAQ patch already in November, but got no reaction...

At the time I intended to create a chapter in the documentation on XA, but 
didn't have the time then and still don't now.  So, patch applied.

Kris Jurka



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


end of thread, other threads:[~2007-04-20 02:18 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29 15:34 FAQ update about transaction interleaving Heikki Linnakangas <heikki@enterprisedb.com>
2006-09-29 21:39 Re: FAQ update about transaction interleaving Mikael Carneholm <Mikael.Carneholm@WirelessCar.com>
2007-04-17 11:15 FAQ update about transaction interleaving Heikki Linnakangas <heikki@enterprisedb.com>
2007-04-20 02:18 ` Kris Jurka <books@ejurka.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