Re: Connection breaks with in transaction with a commit - Mailing list pgsql-jdbc

From Craig Ringer
Subject Re: Connection breaks with in transaction with a commit
Date
Msg-id 47FBB7D5.9050600@postnewspapers.com.au
Whole thread Raw
In response to Connection breaks with in transaction with a commit  (Pushker Chaubey <pchaubey@vertex.co.in>)
List pgsql-jdbc
Pushker Chaubey wrote:
> Hi,
>
> I am new to postgres and jdbc.
> I am facing a very strange problem. I initiate a transaction with
> con.setAutocommitOn(false). My transaction contains two prepare
> statements (first one is select, second one is update query) and then a
> batch query of prepared insert statements. It executes first two
> statements successfully and then while preparing the next
> prepareStatement, the connection breaks and commits the data updated so
> far in the transaction.
If the connection is really breaking, shouldn't that result in an
automatic ROLLBACK on the server side?

Try enabling log_statement and log_connection in the PostgreSQL server
logs, running your tests, and examining the server logs. Your database
access tools might be doing a commit behind your back.

--
Craig Ringer

pgsql-jdbc by date:

Previous
From: Pushker Chaubey
Date:
Subject: Connection breaks with in transaction with a commit
Next
From: Sergi Vera
Date:
Subject: invalid message format and I/O error while comunicating with backend