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
While using SimpleJpaRepository.deleteAllInBatch method with about 500 entities I noticed that the called hibernate library tends to throw a StackOverflowError due to its antlr parsing nature.
To prevent this spring data jpa should not create an sql statement like
it generates a query like delete from table where alias in (?1, ?2, ...)
mp911de
changed the title
suggestion: improve QueryUtils.applyAndBind
Improve QueryUtils.applyAndBind(…) to avoid StackOverflowError with many entities
Jan 23, 2025
We now use an IN (?1) predicate to avoid repeated OR alias = … variants to ease on JPQL parsing. With a sufficient number of predicates, parsers dive into a very deep parsing tree risking a StackOverflowError.
Closes#2870
While using SimpleJpaRepository.deleteAllInBatch method with about 500 entities I noticed that the called hibernate library tends to throw a StackOverflowError due to its antlr parsing nature.
To prevent this spring data jpa should not create an sql statement like
Instead, sql in should be used:
https://github.com/spring-projects/spring-data-jpa/blob/main/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java#L522
The text was updated successfully, but these errors were encountered: