Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update

Поиск
Список
Период
Сортировка
От Roland Roberts
Тема Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update
Дата
Msg-id 49C42D22.2010101@astrofoto.org
обсуждение исходный текст
Ответ на Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update  (Roland Roberts <roland@astrofoto.org>)
Список pgsql-jdbc
Oliver Jowett wrote:
> Roland Roberts wrote:
>
>> Oliver Jowett wrote:
>>
>>> Roland Roberts wrote:
>>>
>>>
>>>> Yes, restrict the timestamp to millisecond precision.  Somewhere the
>>>> sub-millisecond parts are getting lost.  I have no idea if it is in the
>>>> JDBC layer or somewhere in Hibernate.  Any clues on figuring this out?
>>>>
>>> Is the server built with integer_datetimes? Maybe you are just hitting a
>>> rounding problem.
>>>
>> Which server; do you mean PostgreSQL or JBoss?  I think you mean JBoss,
>> but I'm not sure how to check on that.  If you know, please share.  I'll
>> see what I can find out.
>>
> No, I mean the PostgreSQL server.
>
roland=# show integer_datetimes;
 integer_datetimes
-------------------
 off
(1 row)

When I use a trigger to set the timestamps, they show up with
microsecond precision.  The problem is that the extra precision is
definitely getting lost before Hibernate tries to put the value back.
The update looks more-or-less like

update mytable set col1=val1 where primary_key = pkval and
some_timestamp = timestamp_value

timestamp_value doesn't match what is in the database even though it was
retrieved by an earlier query.

I've got some more poking I can do.  Java doesn't seem to have a way of
printing microseconds for timestamps with, for example,
SimpleDateFormat, but I should be able to see if it can at least
retrieve them.

roland

--
               PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                            6818 Madeline Court
roland@astrofoto.org                           Brooklyn, NY 11220


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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update
Следующее
От: Roland Roberts
Дата:
Сообщение: Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update