pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC Driver Modifies Calendar passed into setTimestamp() creates problem with Hibernate
4+ messages / 3 participants
[nested] [flat]

* JDBC Driver Modifies Calendar passed into setTimestamp() creates problem with Hibernate
@ 2005-04-26 16:58 Michael Youngstrom <youngm@gmail.com>
  2005-04-26 17:08 ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Youngstrom @ 2005-04-26 16:58 UTC (permalink / raw)
  To: pgsql-jdbc

There appears to be a possible problem with PreparedStatement's

setTimestamp(int parameterIndex, Timestamp x, Calendar cal)

The Calendar object passed into this method is modified by
PostgreSQL's JDBC driver.  This causes problems with Hibernate.  I
offered a solution for hibernate to clone the calendar before calling
the method but Gavin King of Hibernate believes it's the JDBC driver's
problem.  Here is the link to the hibernate bug discussed.

http://opensource.atlassian.com/projects/hibernate/browse/HHH-405

Mike



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: JDBC Driver Modifies Calendar passed into setTimestamp()
  2005-04-26 16:58 JDBC Driver Modifies Calendar passed into setTimestamp() creates problem with Hibernate Michael Youngstrom <youngm@gmail.com>
@ 2005-04-26 17:08 ` Dave Cramer <pg@fastcrypt.com>
  2005-04-26 21:23   ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Dave Cramer @ 2005-04-26 17:08 UTC (permalink / raw)
  To: Michael Youngstrom <youngm@gmail.com>; +Cc: pgsql-jdbc

I'd suggest that we shouldn't be modifying the calendar object either.

Without looking at the bug, I'd probably agree with him.

dave

Michael Youngstrom wrote:

>There appears to be a possible problem with PreparedStatement's
>
>setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
>
>The Calendar object passed into this method is modified by
>PostgreSQL's JDBC driver.  This causes problems with Hibernate.  I
>offered a solution for hibernate to clone the calendar before calling
>the method but Gavin King of Hibernate believes it's the JDBC driver's
>problem.  Here is the link to the hibernate bug discussed.
>
>http://opensource.atlassian.com/projects/hibernate/browse/HHH-405
>
>Mike
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>
>
>  
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: JDBC Driver Modifies Calendar passed into setTimestamp()
  2005-04-26 16:58 JDBC Driver Modifies Calendar passed into setTimestamp() creates problem with Hibernate Michael Youngstrom <youngm@gmail.com>
  2005-04-26 17:08 ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Dave Cramer <pg@fastcrypt.com>
@ 2005-04-26 21:23   ` Oliver Jowett <oliver@opencloud.com>
  2005-04-27 04:04     ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Oliver Jowett @ 2005-04-26 21:23 UTC (permalink / raw)
  To: pg@fastcrypt.com; +Cc: Michael Youngstrom <youngm@gmail.com>; pgsql-jdbc

Dave Cramer wrote:
> I'd suggest that we shouldn't be modifying the calendar object either.
> 
> Without looking at the bug, I'd probably agree with him.

I took a brief look at setTimestamp etc a few weeks ago and they looked
pretty horrible :(

Who's looking after that bit of the code at the moment? It probably
needs an owner at a minimum. (I'd offer to rewrite it, but I have no
time to spend on the driver at the moment..)

-O



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: JDBC Driver Modifies Calendar passed into setTimestamp()
  2005-04-26 16:58 JDBC Driver Modifies Calendar passed into setTimestamp() creates problem with Hibernate Michael Youngstrom <youngm@gmail.com>
  2005-04-26 17:08 ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Dave Cramer <pg@fastcrypt.com>
  2005-04-26 21:23   ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Oliver Jowett <oliver@opencloud.com>
@ 2005-04-27 04:04     ` Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Dave Cramer @ 2005-04-27 04:04 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Michael Youngstrom <youngm@gmail.com>; pgsql-jdbc

Oliver,

Not sure anyone is tending to that code at the moment, I'll patch it so 
that it doesn't modify the incoming
calendar object.

Oliver Jowett wrote:

>Dave Cramer wrote:
>  
>
>>I'd suggest that we shouldn't be modifying the calendar object either.
>>
>>Without looking at the bug, I'd probably agree with him.
>>    
>>
>
>I took a brief look at setTimestamp etc a few weeks ago and they looked
>pretty horrible :(
>
>Who's looking after that bit of the code at the moment? It probably
>needs an owner at a minimum. (I'd offer to rewrite it, but I have no
>time to spend on the driver at the moment..)
>
>-O
>
>
>  
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-04-27 04:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-26 16:58 JDBC Driver Modifies Calendar passed into setTimestamp() creates problem with Hibernate Michael Youngstrom <youngm@gmail.com>
2005-04-26 17:08 ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Dave Cramer <pg@fastcrypt.com>
2005-04-26 21:23   ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Oliver Jowett <oliver@opencloud.com>
2005-04-27 04:04     ` Re: JDBC Driver Modifies Calendar passed into setTimestamp() Dave Cramer <pg@fastcrypt.com>

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