# Pageable default value in 5.3.x

**URL:** <https://discourse.hibernate.org/t/pageable-default-value-in-5-3-x/891>\
**Category:** Hibernate ORM\
**Created:** [June 6, 2018, 9:21am UTC](https://discourse.hibernate.org/t/pageable-default-value-in-5-3-x/891 "2018-06-06T09:21:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scorp29](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@scorp29](https://discourse.hibernate.org/u/scorp29)\
**Post date:** [June 6, 2018, 9:21am UTC](https://discourse.hibernate.org/t/pageable-default-value-in-5-3-x/891/1 "2018-06-06T09:21:44Z")

</div>

Hello,

I am currently experiencing problems during the migration of hibernate 5.2 to 5.3, regarding pagination.

Indeed, I used a default value, in order to disable this one: @PageableDefault (page = 0, size = Integer.MAX\_VALUE) and PageRequest.of (0, Integer.MAX\_VALUE) java side when necessary.

But since switching to version 5.3.1, I have the following error on my queries: “max-results can not be negative; nested exception is java.lang.IllegalArgumentException: max-results can not be negative”, and an error 409 is adjourned.

Do you know how to get around the problem?

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [June 6, 2018, 9:36am UTC](https://discourse.hibernate.org/t/pageable-default-value-in-5-3-x/891/2 "2018-06-06T09:36:05Z")

</div>

Send us a test case that replicate the issue:

[http://in.relation.to/2018/06/04/best-way-write-hibernate-orm-issue-test-case/](http://in.relation.to/2018/06/04/best-way-write-hibernate-orm-issue-test-case/)

Thanks

---

<div class="post-metadata">

**Author:** ![Werner\_Altewischer](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/werner_altewischer/32/3145_2.png) [@Werner\_Altewischer](https://discourse.hibernate.org/u/Werner_Altewischer)\
**Post date:** [April 5, 2024, 12:37pm UTC](https://discourse.hibernate.org/t/pageable-default-value-in-5-3-x/891/3 "2024-04-05T12:37:28Z")

</div>

I think the problem is when using Spring slices instead of pages. To be able to tell whether there is a next slice spring will add one to the max results. If there is one result more than the size of the current slice it knows that there is a next slice. However, adding 1 to Integer.MAX\_VALUE results in a negative number.
