pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roland Roberts <roland@astrofoto.org>
To: pgsql-jdbc@postgresql.org
Subject: Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update
Date: Fri, 20 Mar 2009 19:56:18 -0400
Message-ID: <49C42D22.2010101@astrofoto.org> (raw)
In-Reply-To: <49C42912.1010807@opencloud.com>
References: <49C3C5FB.20706@astrofoto.org>
	<49C4150B.8060902@opencloud.com>
	<49C42855.3050608@astrofoto.org>
	<49C42912.1010807@opencloud.com>

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




view thread (9+ messages)  latest in thread

Message-ID: <49C42D22.2010101@astrofoto.org>
Permalink:  ../49C42D22.2010101@astrofoto.org/
Also on:    postgresql.org/message-id/49C42D22.2010101@astrofoto.org

 · 

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: roland@astrofoto.org
  Subject: Re: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update
  In-Reply-To: <49C42D22.2010101@astrofoto.org>
  References: <49C3C5FB.20706@astrofoto.org> <49C4150B.8060902@opencloud.com> <49C42855.3050608@astrofoto.org> <49C42912.1010807@opencloud.com> <49C42D22.2010101@astrofoto.org>

* 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