Re: Connection breaks with in transaction with a commit

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Pushker Chaubey <pchaubey(at)vertex(dot)co(dot)in>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Connection breaks with in transaction with a commit
Date: 2008-04-08 18:22:13
Message-ID: 47FBB7D5.9050600@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sergi Vera 2008-04-09 12:07:34 invalid message format and I/O error while comunicating with backend
Previous Message Pushker Chaubey 2008-04-08 11:54:23 Connection breaks with in transaction with a commit