Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UB5KF-0003pI-4a for pgsql-jdbc@arkaria.postgresql.org; Thu, 28 Feb 2013 15:23:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UB5KE-0008RA-GZ for pgsql-jdbc@arkaria.postgresql.org; Thu, 28 Feb 2013 15:23:14 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UB5KD-0008R4-SH for pgsql-jdbc@postgresql.org; Thu, 28 Feb 2013 15:23:14 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UB5K8-0001yd-5c for pgsql-jdbc@postgresql.org; Thu, 28 Feb 2013 15:23:12 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id C317A28446; Thu, 28 Feb 2013 07:23:06 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id BFA454019F; Thu, 28 Feb 2013 07:23:06 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id E94A91219E0; Thu, 28 Feb 2013 07:26:27 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H7DCN6boER77; Thu, 28 Feb 2013 07:26:27 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id C4F7C121997; Thu, 28 Feb 2013 07:26:27 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Thu, 28 Feb 2013 07:26:26 -0800 (PST) Message-ID: <512F7657.8010300@vmware.com> Date: Thu, 28 Feb 2013 17:23:03 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Andrew Frolov CC: pgsql-jdbc@postgresql.org, andrey.o.vorobiev@gmail.com Subject: Re: PostgreSQL JDBC bug with XA recovery? References: <512F6F9F.9000906@gmail.com> In-Reply-To: <512F6F9F.9000906@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.6 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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.com 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