Hibernate 6.2.2.Final OffsetTime wrong timeZone saved

I have a Backend (upgraded from SpringBoot 2) on Spring Boot 3.0.13 with Hibernate 6.1.7.Final Spring 6.0.14 Everything waas fine with DateTime, OffsetTime, ZoneDateTime, + Timezone (application.yml property hibernate.jdbc.time_zone: UTC)

Database is MySql 8.0.32 and offset_time column is “Time” type.

When I upgraded to Spring Boot 3.1.0 with Hibernate 6.2.2.Final Spring 6, my OffsetTime is not saved correctly in database and Timezone “serialization” is not correct.

@Column(name = "offset_time")
private OffsetTime offsetTime;

And YML proprties

  jpa:
    open-in-view: false
    properties:
      hibernate.jdbc.time_zone: UTC
      hibernate.timezone.default_storage: NORMALIZE_UTC
  • offsetTime variable is “14:30Z” before saving
  • SELECT value time from database is “1970-01-01T13:30:00.000+0100”

So offsetTime is saved as if UTC is not considered with -1h and set in database with +1h keeping system default instead of stay in UTC. It seems to be an Hibernate 6.2.2 issue but I would like to knwo if there is a way to fix it.

Hibernate ORM 6.1 is not supported anymore. Please update to version 6.4.4.Final.
If you still have problems, please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.

Ok I will uprade to Hibernate 6.4.4 and telle you. We made a little try and issue was still here.

Hi
I confirm the same TimeZone “gap” in SpringBoot 3.2.3 (Hibernate 6.4.4.Final, Spring 6.1.4).
I’m going to try to use your test template.