| Ok so I tried to reproduce your issues to but couldn't. What I tried so far was
- Start MySQL with TZ +01:00
- Write LocalDate values into the DB with TZ +00:00 as well as with TZ +02:00
- Read the values with TZ +00:00, +01:00 and +02:00
When reading, the LocalDates were all correct. I tried various JDBC configurations. The one you posted as well as configurations without some of the properties i.e. serverTimezone, useJDBCCompliantTimezoneShift etc. The testcase you wrote wrongly assumes that a java.sql.Date object created with one TZ is going to give the same LocalDate when using toLocalDate() within a different timezone. I don't understand how this can actually happen. Either your assumption about what happens in your case is wrong or you didn't give enough information about your scenario. If you still think this is a Hibernate problem you gonna have to tell me more details. |