-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Spring data specification is not working as expected with pageable #3224
Comments
Care to attach the full stack trace? The one is truncated and doesn't show the actual cause. |
@mp911de Have updated the full stack trace in issue |
Alright. Thanks a lot. With
you can post the full stack trace at the Hibernate forums as the underlying cause is a Hibernate exception. The top-most exception, Let me know how the Forum discussion goes. I will leave this ticket open until we get further guidance from the Hibernate team. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Hey ! OP did post his issue in Hibernate forums and issue is kinda stuck there too. It seems i'm having myself trouble with this same issue. Debugging between Spring-JPA & Hibernate-SQM isn't really my thing but it seems the issue comes from the underlying countQuery from SimpleJpaRepository when using a Pageable. Debugging in But the second request coming from I use |
@mfrechePgest if you have something like a minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem please feel free to reopen this issue since it was auto closed due to lack of feedback. Thank you! |
@christophstrobl Thanks ! Just run Junit test, it should crash Writing it showed me the crash occurs when there's more results than the requested page size. |
@christophstrobl Sry for spam but you told me to
Don't think I can do this myself ? How ? |
Update : I found a fix in the simple repo In my real production repository, Specification is obviously more complicated but we can refactor it so we don't have any instance attributes. Can't say if there's an underlying bug anyway, but at least i've got a workaround. EDIT : And OP had the same thing too : his |
Environment:
We are working with Spring Data specification for creating dynamic queries and have Pagination. Getting the following error in some cases where we change the values of Pageable size and page.
Specification:
Pageable:
The current change is working as expected in a few cases but failing in other cases.
Working case: Suppose the total rows in the reports table are 15 and if we make the Pageable request. Here, the page.number * page.size is around the total number of rows in the database table.
Failed case:
The above specification is a basic filter, it will be dynamic and should able to handle mutiples columns to query across multiple Join tables.
is the above behavior of Specification and pageable expected? Did we miss some configuration or any other changes?
Full stack trace:
StackOverflow
Hibernate Forum
Edited- Full stack trace
The text was updated successfully, but these errors were encountered: