Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 25DAC650119 for ; Tue, 29 Jul 2008 01:25:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71968-01-3 for ; Tue, 29 Jul 2008 01:25:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 8D2DC64FF05 for ; Tue, 29 Jul 2008 01:22:52 -0300 (ADT) Received: (qmail 4128 invoked by uid 1112); 29 Jul 2008 04:22:52 -0000 Date: Tue, 29 Jul 2008 00:22:52 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: David Rees cc: pgsql-jdbc@postgresql.org Subject: Re: Timestamp Problems In-Reply-To: <72dbd3150807231300w60e35ba9xc512930146481718@mail.gmail.com> Message-ID: References: <72dbd3150807231300w60e35ba9xc512930146481718@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/59 X-Sequence-Number: 18844 On Wed, 23 Jul 2008, David Rees wrote: > What is strange is that this does not happen all the time, and that it > only affects this one particular column! Anything going wrong should be reproducible unless your app is doing something weird temporarily behind the scenes like TimeZone.setDefault. > Timestamp 1 = 2008-07-23 18:33:59.0 - new Date: Wed Jul 23 18:33:59 EDT 2008 > Update & Refresh > Timestamp 2 = 2008-07-23 22:33:59.0 - new Date: Wed Jul 23 18:33:59 EDT 2008 > > Yeah, that's right, getTime() is returning the same value even though > toString() prints different values and different values get inserted > in to the database! You need to check getTimezoneOffset on the two timestamp values. You can see the dates being printed with the timezone showing they're the same, but I'm betting they aren't for the timestampts. > After a lot of troubleshooting, I've finally figured out that by > disabling the stored procedure cache used by Hibernate (I've > configured Hibernate to use c3p0's database connection pool and > prepared statement cache) this issue doesn't crop up any more. > I can't imagine why that would be relevant. Kris Jurka