Skip to content
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

JPA query with is null and pageable gives InvalidDataAccessResourceUsageException when result size is bigger than page size #3791

Closed
aperreaultaubeupgrade opened this issue Feb 26, 2025 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@aperreaultaubeupgrade
Copy link

We observe the following behaviour starting with spring-data-jpa 3.3.9. (3.3.8 was fine)

With a JPA query like this

   @Query("""
        SELECT p.id
        FROM Parent p
        WHERE (:ids is null OR p.id IN (:ids))
    """)
    Page<Long> withIds(@Param("ids")List<Long> ids, Pageable pageable);

if the result size is bigger than the Pageable page size it throws

org.springframework.dao.InvalidDataAccessResourceUsageException: No argument for named parameter ':ids_1'

if the result size is smaller than the Pageable page size it behaves like expected.

see this branch to reproduce
https://github.com/spring-projects/spring-data-jpa/compare/3.3.9...aperreaultaubeupgrade:spring-data-jpa:jpa-is-null-pageable-bug?expand=1

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 26, 2025
@christophstrobl
Copy link
Member

Thank you for getting in touch - seems you're hitting a regression reported via #3784.

@christophstrobl christophstrobl added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants