Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquibase OffsetDateTime issues with Hibernate 6.2 in StandardLockService #4503

Open
1 of 2 tasks
MarkKunze opened this issue Jul 18, 2023 · 1 comment
Open
1 of 2 tasks
Labels

Comments

@MarkKunze
Copy link

Search first

  • I searched and no similar issues were found

Description

Using liquibase 4.23.0 in Spring Boot 3.1.1 coming with Hibernate 6.2

there were changes with Hibernate storing Time. It now maps time related Values to OffsetDateTime. The Method

liquibase.lockservice.StandardLockService#listLocks (https://github.com/liquibase/liquibase/blob/master/liquibase-standard/src/main/java/liquibase/lockservice/StandardLockService.java) can only handle LocalDateTime and Date. This results in and LockException with a ClassCastException as root:

iquibase.exception.LockException: java.lang.ClassCastException: class java.time.OffsetDateTime cannot be cast to class java.util.Date (java.time.OffsetDateTime and java.util.Date are in module java.base of loader 'bootstrap') at liquibase.lockservice.StandardLockService.listLocks(StandardLockService.java:452)

I think best way would be to also Handle OffsetDateTime als an alternative to LocalDateTime and Date.

Downgrading Hibernate again to 6.1 this works.

Steps To Reproduce

  1. Create service with a simple changelog.
  2. Put manually a lock on the Database
  3. Call liquibase.lockservice.StandardLockService#listLocks

Expected/Desired Behavior

Returning current active Locks.

Liquibase Version

4.23.0

Database Vendor & Version

H2

Liquibase Integration

maven, springboot, hibernate

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

No response

Additional Context

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@lbruun
Copy link

lbruun commented Dec 16, 2023

When Liquibase fires, it doesn't use JPA (Hibernate). It solely works at the JDBC level, AFAIK.
So a change to how Hibernate does things would be completely irrelevant to Liquibase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Open Issues
Development

No branches or pull requests

3 participants