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

JPA exception mapping fails with Hibernate 6.1.1 in spring 6.0.0-M5 #28855

Closed
aspan opened this issue Jul 22, 2022 · 0 comments
Closed

JPA exception mapping fails with Hibernate 6.1.1 in spring 6.0.0-M5 #28855

aspan opened this issue Jul 22, 2022 · 0 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Milestone

Comments

@aspan
Copy link
Contributor

aspan commented Jul 22, 2022

Spring version 6.0.0-M5

Exception mapping fails with java.lang.NoSuchMethodError

Caused by: java.lang.NoSuchMethodError: 'java.io.Serializable org.hibernate.StaleObjectStateException.getIdentifier()'
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:304)
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:232)

In Hibernate 5 the method had the following signature:

java.io.Serializable org.hibernate.StaleObjectStateException.getIdentifier()

But it has changed in hibernate 6.x to be:

java.lang.Object org.hibernate.StaleObjectStateException.getIdentifier()

The change was made in this commit
hibernate/hibernate-orm@5b3c6c4#diff-97a3fcd51fd4aefa42e50567ebf6dec8d8f404d2e5be39f6b4647c1698ef3aba

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 22, 2022
@aspan aspan changed the title JPA exception mapping fails with Hibernate 6.1.1 JPA exception mapping fails with Hibernate 6.1.1 in spring 6.0.0-M5 Jul 22, 2022
@jhoeller jhoeller self-assigned this Jul 22, 2022
@jhoeller jhoeller added in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 22, 2022
@jhoeller jhoeller added this to the 6.0.0-M6 milestone Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants