You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spring Data JPA 2.6.3 version, when we use the method related to the field Contains, the result is normal for the first query. However, on the second request it throws an error like below.
I wrote the simplest demo jpa-bug-demo, you can git clone https://github.com/blinkfox/jpa-bug-demo, and then execute mvn test the problem occurs.
or start the JpaBugDemoApplication server, Access the http://127.0.0.1:8080/users url of the service, the first time is normal, when you request this URL for the second time, an exception similar to the above will be thrown.
When I change the version of Spring Boot to 2.6.4 or the version of Spring Data JPA to 2.6.2, there is no such problem.
The main code is:
List<User> findByNameContains(Stringname);
problem analysis
After some investigation, the jar that caused the problem is actually hibernate-core, and its version is 5.6.6.Final and later, it will cause this problem. The 5.6.5.Final version does not cause this problem.
The more detailed reasons are not yet known. Through some of the above codes and clues, you may be able to find the reasons faster.
The text was updated successfully, but these errors were encountered:
Hello, to temporarily solve the error you could set a parameter @Param("param")String param so that spring jpa does not display the error, I attach a screenshot.
You can check the thread in the link I shared @schauder
In Spring Data JPA 2.6.3 version, when we use the method related to the field Contains, the result is normal for the first query. However, on the second request it throws an error like below.
How to reproduce this problem
I wrote the simplest demo jpa-bug-demo, you can
git clone https://github.com/blinkfox/jpa-bug-demo
, and then executemvn test
the problem occurs.or start the
JpaBugDemoApplication
server, Access thehttp://127.0.0.1:8080/users
url of the service, the first time is normal, when you request this URL for the second time, an exception similar to the above will be thrown.When I change the version of Spring Boot to
2.6.4
or the version of Spring Data JPA to2.6.2
, there is no such problem.The main code is:
problem analysis
After some investigation, the jar that caused the problem is actually
hibernate-core
, and its version is5.6.6.Final
and later, it will cause this problem. The5.6.5.Final
version does not cause this problem.The more detailed reasons are not yet known. Through some of the above codes and clues, you may be able to find the reasons faster.
The text was updated successfully, but these errors were encountered: