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