|
Hibernate 3.0.5, JDK 1.4.2, WebLogic 8.1.4, Oracle 9i.
I have a column of type "TIMESTAMP WITH LOCAL TIME ZONE". I'm mapping that to "java.sql.Timestamp" with Hibernate.
I have a dbinit script that creates this data. After I run the init, I view the data with SQLDeveloper, and the value appears to be ok. In SQLDeveloper, it shows what appears to be my current time. All through this, I'm refreshing the view in SQLDeveloper, and it looks fine all the time.
My app running in WebLogic with Hibernate reads this value, but it does not write it. My app is a message router, and it will read this column every time a message is received.
I set a breakpoint on the "set" method of the POJO mapped in Hibernate, and then I queued up several identical messages to process. When it hits the breakpoint, I view the value of the Timestamp object.
What I'm seeing is that the first time it hits the breakpoint, the "Timestamp.toString()" shows the same value that I see in SQLDeveloper, and my code that uses the value works fine. However, the next two times (each corresponding to a single input message to the message router) I hit the breakpoint, the value it is getting is exactly 1 hour plus the correct value. When my code uses this value, it thinks a bunch of other things need to be reloaded, so it loads lots of other tables from the database.
After getting the wrong value twice, it then reverts back to getting the correct value, and then continues the cycle. I don't know whether the sequence of 1 good and 2 bad is due to timing (because the two bad ones cause reload of data from other tables), or some other race condition.
|