Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5Vhs-00010E-TD for pgsql-jdbc@arkaria.postgresql.org; Wed, 25 May 2016 10:06:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5Vhs-0006d5-CW for pgsql-jdbc@arkaria.postgresql.org; Wed, 25 May 2016 10:06:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5VhN-0005Zo-Hv for pgsql-jdbc@postgresql.org; Wed, 25 May 2016 10:05:57 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5VhE-0000Vt-5A for pgsql-jdbc@postgresql.org; Wed, 25 May 2016 10:05:56 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E654E37E62; Wed, 25 May 2016 10:05:44 +0000 (UTC) Received: from [10.36.116.80] (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4PA5hsF005983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 May 2016 06:05:44 -0400 Subject: Re: Two-phase commit with JDBC To: Edson Richter References: From: Jeremy Whiting Cc: "pgsql-jdbc@postgresql.org" Message-ID: <166789ed-b4c0-a26a-9ce7-be38ccafc350@redhat.com> Date: Wed, 25 May 2016 11:05:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------0F852B178E05F47F97B70B2F" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 25 May 2016 10:05:44 +0000 (UTC) X-Pg-Spam-Score: -8.3 (--------) 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 This is a multi-part message in MIME format. --------------0F852B178E05F47F97B70B2F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi Edson, Two phase commit is a protocol developed by the The Open Group. The group created a standard known as Open XA [1]. PostgreSQL using JDBC provides an implementation of the XA spec. Supporting two phase commit. The sample application you ask for is beyond J2SE and in JEE [2] instead. Unless of course you accept using JTA api. This book is suggested reading and has examples. Look for examples with UserTransaction [3]. ISBN 0-13-035290-X Regards, Jeremy [1] https://en.wikipedia.org/wiki/X/Open_XA [2] https://docs.oracle.com/javaee/7/tutorial/ [3] https://docs.oracle.com/javaee/7/api/javax/transaction/UserTransaction.html On 25/05/16 00:45, Edson Richter wrote: > > Hi, > > Can I use two phase commit in PostgreSQL using JDBC without JTA or XA > specialized libraries (I mean, JDBC only)? > > Is there any simple J2SE example around? > > > Thanks, > > -- > Atenciosamente, > > Edson Carlos Ericksson Richter -- Jeremy Whiting Senior Software Engineer, JBoss Performance Team Red Hat ------------------------------------------------------------ Registered Address: RED HAT UK LIMITED, Peninsular House, 30-36 Monument Street, 4th floor, London. EC3R 8NB United Kingdom Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (US), Michael ("Mike") O'Neill (Ireland) and Eric Shander (US) --------------0F852B178E05F47F97B70B2F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Hi Edson,
 Two phase commit is a protocol developed by the The Open Group. The group created a standard known as Open XA [1].
 PostgreSQL using JDBC provides an implementation of the XA spec. Supporting two phase commit.

 The sample application you ask for is beyond J2SE and in JEE [2] instead.
 Unless of course you accept using JTA api. This book is suggested reading and has examples. Look for examples with UserTransaction [3].

ISBN 0-13-035290-X

Regards,
Jeremy

[1] https://en.wikipedia.org/wiki/X/Open_XA
[2] https://docs.oracle.com/javaee/7/tutorial/
[3] https://docs.oracle.com/javaee/7/api/javax/transaction/UserTransaction.html

On 25/05/16 00:45, Edson Richter wrote:

Hi,

Can I use two phase commit in PostgreSQL using JDBC without JTA or XA specialized libraries (I mean, JDBC only)?

Is there any simple J2SE example around?


Thanks,

-- 
Atenciosamente,

Edson Carlos Ericksson Richter


-- 
Jeremy Whiting
Senior Software Engineer, JBoss Performance Team
Red Hat

------------------------------------------------------------
Registered Address: RED HAT UK LIMITED, Peninsular House, 30-36 Monument Street, 4th floor, London. EC3R 8NB United Kingdom
Registered in UK and Wales under Company Registration No. 3798903  Directors: Michael Cunningham (US), Michael ("Mike") O'Neill (Ireland) and Eric Shander (US) 
--------------0F852B178E05F47F97B70B2F--