Re: Timestamp Problems

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Timestamp Problems
Дата
Msg-id Pine.BSO.4.64.0807290018110.2814@leary.csoft.net
обсуждение исходный текст
Ответ на Timestamp Problems  ("David Rees" <drees76@gmail.com>)
Список pgsql-jdbc

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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Passing arrays
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: GSSAPI/KRB5 and JDBC (again)