Re: Issue with now() within a transaction in pg74.213.jdbc.jar

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: thebfh(at)toolsmythe(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Issue with now() within a transaction in pg74.213.jdbc.jar
Date: 2004-07-02 00:42:27
Message-ID: 40E4AF73.6010608@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

John Pagakis wrote:
> Most of my tables have a last update date and during some testing in
> Postgres 7.4.1 I noticed that the last_update date was slightly in the past
> for anything updated within a transaction. The amount it is off by seems to
> vary: as little as 30 seconds; as much as a couple of minutes.
>
> Tables updated outside of a transaction seem to have an accurate timestamp.
> If I setAutoCommit(true) instead of setAutoCommit(false) and comment out my
> commit/rollbacks, the timestamp is accurate. Within a transaction, it is as
> though I have set the WayBack machine for a random trip 1/2 - 2 minutes back
> in time.
>
> I am using pg74.213.jdbc.jar. Is there a more current driver?
>
> Has anyone else noticed this? Is anyone looking at it?

Older drivers issue a BEGIN immediately after the previous transaction
commits or rollbacks. This freezes the value of now() at that point. It
also manifests as idle backends being "idle in transaction" all the time.

Upgrade to a more recent driver. Current CVS should be fine against a
7.4 server. See http://jdbc.postgresql.org

-o

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Christopher Farley 2004-07-02 04:37:37 Puzzling Unix CLASSPATH issue...
Previous Message Dave Cramer 2004-07-02 00:30:36 Re: Issue with now() within a transaction in