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