X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 314B7D1B377 for ; Thu, 1 Jul 2004 21:40:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90970-09 for ; Fri, 2 Jul 2004 00:40:28 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 5A751D1B342 for ; Thu, 1 Jul 2004 21:40:23 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BgC6L-0004yq-00; Fri, 02 Jul 2004 12:40:25 +1200 Message-ID: <40E4AF73.6010608@opencloud.com> Date: Fri, 02 Jul 2004 12:42:27 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: thebfh@toolsmythe.com Cc: pgsql-jdbc@postgresql.org Subject: Re: Issue with now() within a transaction in pg74.213.jdbc.jar References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/7 X-Sequence-Number: 10391 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