Re: Warning on transaction commit - Mailing list pgsql-jdbc

From Sziklai Gabor
Subject Re: Warning on transaction commit
Date
Msg-id 00b801c2bba8$823c87a0$0a00a8c0@ibase
Whole thread Raw
In response to Warning on transaction commit  (Jeremy Buchmann <jeremy@wellsgaming.com>)
List pgsql-jdbc
Greetings,

As far as I know, the implementation of setAutoCommit( true ) is sending an
"END"
to the backend. Since you had just committed before, there is no transaction
taking place - hence the warning.

Setting autocommit to false entails that each commit() will send a
"COMMIT;BEGIN;" to the backend, while each rollback() will send a
"ROLLBACK;BEGIN;".

Regards,

Gabor

> I'm getting a warning message in my logs that looks like this:
>
> WARNING:  COMMIT: no transaction in progress
>
> when I run this code:
>
> dbh.setAutoCommit(false);
> Statement doEvents = dbh.createStatement();
> doEvents.executeUpdate("DELETE FROM ...");
> doEvents.executeUpdate("INSERT INTO ...");
> dbh.commit();
> dbh.setAutoCommit(true);
>
> The statements do what they're supposed to do, but I don't understand
> why I'm getting that warning message.  Anyone know why?
>
> I'm running PostgreSQL 7.3.1 and using the PostgreSQL 7.3 JDBC 2 driver
> that I just downloaded a couple days ago from jdbc.postgresql.org.
>
> Thanks,
> --Jeremy
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Patch so Pooled Connections are PGConnections
Next
From: Barry Lind
Date:
Subject: Re: Truncation bug when retrieving timestamps with fractional