pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: David Rees <drees76@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Timestamp Problems
Date: Tue, 29 Jul 2008 00:22:52 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0807290018110.2814@leary.csoft.net> (raw)
In-Reply-To: <72dbd3150807231300w60e35ba9xc512930146481718@mail.gmail.com>
References: <72dbd3150807231300w60e35ba9xc512930146481718@mail.gmail.com>



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




view thread (9+ messages)

Message-ID: <Pine.BSO.4.64.0807290018110.2814@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0807290018110.2814@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0807290018110.2814@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, drees76@gmail.com
  Subject: Re: Timestamp Problems
  In-Reply-To: <Pine.BSO.4.64.0807290018110.2814@leary.csoft.net>
  References: <72dbd3150807231300w60e35ba9xc512930146481718@mail.gmail.com> <Pine.BSO.4.64.0807290018110.2814@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox