Skip site navigation (1) Skip section navigation (2)

Re: Problem with committing in XA mode

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Vlastimil Havranek <vlastimil(dot)havranek(at)xitee(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with committing in XA mode
Date: 2009-01-15 13:28:51
Message-ID: 496F3A13.8050905@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Vlastimil Havranek wrote:
> I am facing tx timeout problem when committing certain tx in XA mode 
> using pure postgre jdbc type 4 driver. The tx is issued/started from 
> within backend deployed on AS BEA Weblogic 10 MP1.
> Ive tried the postgresql-jdbc-8.3-603 jdbc driver, the one bundled with 
> weblogic and also edb jdbc driver.
> In all cases, i see this in db server log:
>    --
>    2009-01-13 13:37:50 LOG:  duration: 0.000 ms  parse <unnamed>: 
> PREPARE TRANSACTION '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:37:50 LOG:  duration: 0.000 ms  bind <unnamed>: PREPARE 
> TRANSACTION '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:37:50 LOG:  duration: 0.000 ms  execute <unnamed>: 
> PREPARE TRANSACTION '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:37:51 LOG:  duration: 0.000 ms  parse <unnamed>: COMMIT 
> PREPARED '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:37:51 LOG:  duration: 0.000 ms  bind <unnamed>: COMMIT 
> PREPARED '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:37:51 ERROR:  prepared transaction with identifier 
> "48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU=" does not exist
>    2009-01-13 13:37:51 STATEMENT:  COMMIT PREPARED 
> '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:38:51 LOG:  duration: 0.000 ms  parse <unnamed>: COMMIT 
> PREPARED '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:38:51 LOG:  duration: 0.000 ms  bind <unnamed>: COMMIT 
> PREPARED '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='
>    2009-01-13 13:38:51 ERROR:  prepared transaction with identifier 
> "48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU=" *does not exist*
>    2009-01-13 13:38:51 STATEMENT:  COMMIT PREPARED 
> '48801_AQeOE4t3Z6MjBA==_Q3ZoYXZyYW5la2pkYmNEU0xpdmU='

Hmm, that's odd. A PREPARE TRANSACTION is clearly being run, and 
followed by a COMMIT PREPARED with the same transaction id, which fails. 
This raises two questions:

1. Why does it say the transaction doesn't exist, and
2. why doesn't Weblogic report error when the first COMMIT PREPARED fails?

Is there anything in the PostgreSQL server log? Could you set 
log_statement='all' so that we get a trace of the statements from the 
server side? (that logs *all* queries to the log, so will generate a lot 
of log if the system is busy)

A possible explanation for 2. is that since the transaction was 
successfully prepared, the RM should be able to commit it eventually. So 
instead of propagating errors in commit, WebLogic just retries.

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

In response to

Responses

pgsql-jdbc by date

Next:From: Vlastimil HavranekDate: 2009-01-15 14:26:13
Subject: Re: Problem with committing in XA mode
Previous:From: Vlastimil HavranekDate: 2009-01-15 13:14:26
Subject: Problem with committing in XA mode

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group