Skip to content

@QueryHints not applied for count queries during pagination using Hibernate #4116

@arunlakra7

Description

@arunlakra7

Example JPA query:

@query("""
SELECT document
FROM DocumentDto document
WHERE (:ids is null OR document.id IN :ids)
""")
@QueryHints(@QueryHint(name = "jakarta.persistence.query.timeout", value = "2000"))
Page findAllBy(
@param("ids") List ids,
Pageable pageable
);

After migrating to Spring 4.0.0 timeout query hint is not applied on the count query even though it is true by default. The count query lasted for 20 seconds

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions