Skip to content

Second call to query method of JpaRepository fails with Hibernate 5.6.6 since Spring Boot 2.6.5 #30421

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

Closed
fstaudt opened this issue Mar 24, 2022 · 5 comments
Labels
for: external-project For an external project and not something we can fix

Comments

@fstaudt
Copy link

fstaudt commented Mar 24, 2022

Since migration to Spring Boot 2.6.5, calls to JpaRepository query method fail with exception java.lang.IllegalArgumentException: Parameter value [\] did not match expected type [java.lang.String (n/a)].

The issue is reproduced in unit test of reproducer project https://github.com/fstaudt/sb265-hibernate-failure :

  • first call to query method findAllByNameContaining(...) succeeds
  • next calls to query method fail

Unit tests pass if Spring Boot version is reverted to 2.6.4.

Issue can also be reproduced at runtime (tested with bootRun), it is not only in unit tests.

I wasn't able to identify the root cause.
I'm not sure that issue is actually in Spring Boot (might as well be in Spring Data or in Hibernate).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 24, 2022
@scottfrederick
Copy link
Contributor

This is a duplicate of spring-projects/spring-data-jpa#2472. As discussed in that issue, overriding the Hibernate version to 5.6.5.Final in the example works around the issue.

@scottfrederick scottfrederick added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 24, 2022
@boskokg
Copy link

boskokg commented Apr 4, 2022

Since this issue makes the runtime error and not the compile error, I think that spring-boot team should release a micro version with downgraded hibernate version even if there is a workaround (not known by many).

@wilkinsona
Copy link
Member

We can't do that as downgrading would expose everyone using Hibernate to all of the bugs that have been fixed since 5.6.5, some of which may not have a workaround. If using 5.6.5 is a better option for you than using 5.6.7 with a workaround for this specific problem, you should opt into that arrangement by overriding the Hibernate version.

@boskokg
Copy link

boskokg commented May 15, 2022

Hello,
Since hibernate released 5.6.9 with this fix, can we expect a new micro version comming soon, or we should override the hibernate dependency to 5.6.9?

Thanks in advance

@wilkinsona
Copy link
Member

We have 2.5.x and 2.6.x releases planned this week which, all being well, will include Hibernate 5.6.9.

@snicoll snicoll unpinned this issue May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

No branches or pull requests

5 participants