pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Fabien JALABERT <fabien.jalabert@laposte.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC: "transaction aborted"
Date: Wed, 01 Sep 2010 16:18:25 +0800
Message-ID: <4C7E0C51.9010708@postnewspapers.com.au> (raw)
In-Reply-To: <4C7E036B.6080407@laposte.net>
References: <54191bbe-6765-4b1c-bbfd-8fd2d9e6024f@f25g2000yqc.googlegroups.com>
	<4C7DB511.9080807@postnewspapers.com.au>
	<4C7E036B.6080407@laposte.net>

On 01/09/10 15:40, Fabien JALABERT wrote:
> Hello, if I turn on autocommit, will I be able to process transactions
> with begin/commit/rollback as before ?

If you mean issuing explicit "BEGIN", "COMMIT" and "ROLLBACK" statements
as SQL text through the JDBC driver ... honestly, I'm not sure. It's not
really how the JDBC interface is intended to work.

Typically when using JDBC you would let the driver take care of this.
You call

  conn.setAutoCommit(false);

... to open a transaction. Any work between then and a subsequent:

  conn.commit()

or

  conn.rollback()

is done in the transaction.



-- 
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/



view thread (4+ messages)  latest in thread

Message-ID: <4C7E0C51.9010708@postnewspapers.com.au>
Permalink:  ../4C7E0C51.9010708@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4C7E0C51.9010708@postnewspapers.com.au

 · 

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: craig@postnewspapers.com.au, fabien.jalabert@laposte.net
  Subject: Re: JDBC: "transaction aborted"
  In-Reply-To: <4C7E0C51.9010708@postnewspapers.com.au>
  References: <54191bbe-6765-4b1c-bbfd-8fd2d9e6024f@f25g2000yqc.googlegroups.com> <4C7DB511.9080807@postnewspapers.com.au> <4C7E036B.6080407@laposte.net> <4C7E0C51.9010708@postnewspapers.com.au>

* 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