pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Andrew Frolov <andrewfrolov@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Cc: andrey.o.vorobiev@gmail.com
Subject: Re: PostgreSQL JDBC bug with XA recovery?
Date: Thu, 28 Feb 2013 17:23:03 +0200
Message-ID: <512F7657.8010300@vmware.com> (raw)
In-Reply-To: <512F6F9F.9000906@gmail.com>
References: <512F6F9F.9000906@gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 28.02.2013 16:54, Andrew Frolov wrote:
> I've encountered a problem with xa transaction recovery.
>
> PGXAConnection.recover() functions returns all pending XA transactions.
> But the problem is, that in general case we cannot recover this
> transactions in current connection, PostgreSQL require us to connect to
> target database before recovering. This behavior breaks the expectations
> of transaction managers. We literally can't perform recovery if we have
> a lot of pending xa transactions in different databases in PostgreSQL
> cluster.
>
> Maybe it would be good to replace
> SELECT gid FROM pg_prepared_xacts
> by
> SELECT gid FROM pg_prepared_xacts,where owner = current_user ?
>
> I found an old thread with same question, but without an answer.
> http://www.postgresql.org/message-id/CAPSK6ngYLaRAy_FGGQqknTPE9FUDCRn32UShxuncWEyD+swD=w@mail.gmail....

There's some confusion here. Both you and the old thread talks about 
transactions in multiple databases being the problem, but the error 
message, and your suggestion above, suggest that the problem is actually 
about permissions. We probably should do:

SELECT gid FROM pg_prepared_xacts where database = current_database()

That should help with the problem with multiple databases. But do you 
also have a problem with multiple PostgreSQL users being involved?

- Heikki


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (3+ messages)  latest in thread

Message-ID: <512F7657.8010300@vmware.com>
Permalink:  ../512F7657.8010300@vmware.com/
Also on:    postgresql.org/message-id/512F7657.8010300@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: hlinnakangas@vmware.com, andrewfrolov@gmail.com, andrey.o.vorobiev@gmail.com
  Subject: Re: PostgreSQL JDBC bug with XA recovery?
  In-Reply-To: <512F7657.8010300@vmware.com>
  References: <512F6F9F.9000906@gmail.com> <512F7657.8010300@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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