-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Oracle timestamp with local time zone
PostPosted: Tue Mar 08, 2005 2:45 pm 
Newbie

Joined: Tue Jul 06, 2004 9:56 am
Posts: 14
Hibernate version:2.1.7

Could not find any issue with that topic, so I ask: if the DB contains a column "timestamp with local time zone", the Oracle JDBC driver (Oracle 10g) complains that the Session Time Zone is not set. Any way to do this? (I will switch to "timestamp with time zone" anyway, just wondering)

Thanks in advance,
Thomas


Top
 Profile  
 
 Post subject: Re: Oracle timestamp with local time zone
PostPosted: Wed Mar 09, 2005 5:00 am 
Newbie

Joined: Wed Mar 31, 2004 11:08 am
Posts: 2
Diederich wrote:
Hibernate version:2.1.7

Could not find any issue with that topic, so I ask: if the DB contains a column "timestamp with local time zone", the Oracle JDBC driver (Oracle 10g) complains that the Session Time Zone is not set. Any way to do this? (I will switch to "timestamp with time zone" anyway, just wondering)

Thanks in advance,
Thomas


Hi,

I've been able to get this working on my own system. Basically all you have to do is get the oracle.jdbc.OracleConnection from your Hibernate Session and then call its setSessionTimeZone() method with the timezone id you wish to set (e.g., c.setSessionTimeZone("US/Pacific")). Be aware that calling setSessionTimeZone() appears to leak a database cursor. If you pool and reuse your JDBC connections a lot, you may want to add a check to first see if the connection's current timezone is the same as what you would like to change it to. Ignoring the unnecessary setting of time zone in the case where new time zone == current time zone will help minimize leakage Hope this helps.

Ryan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.