View Single Post

   
  #2 (permalink)  
Old 04-16-2008, 01:00 AM
Craig Ringer
 
Posts: n/a
Default Re: Connection breaks with in transaction with a commit

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

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Reply With Quote