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

Named query lookups might cause transaction to be rolled back [DATAJPA-617]

Closed
spring-projects-issues opened this issue Oct 23, 2014 · 2 comments
Assignees
Labels
in: core type: bug

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Oct 23, 2014

Oliver Drotbohm opened DATAJPA-617 and commented

The execution of a paged repository method backed by a JPA named query might break the currently running transaction as it tries to look up a named count query but can mitigate a lookup failure. However, the failing lookup causes the transaction to be marked as rollback (as required by the JPA specification).

We should revisit named query validation and execution like we did for manually defined queries using @Query in DATAJPA-350


Affects: 1.6.4 (Dijkstra SR4), 1.7 GA (Evans)

Reference URL: http://stackoverflow.com/questions/26402180/spring-data-jpa-pageable-query-rollbacks-transaction

Issue Links:

  • DATAJPA-724 JPA named query lookup causes rollback transaction in an EJB container

  • DATAJPA-350 Improve query validation by creating explicit EntityManager instance

Referenced from: pull request #110

Backported to: 1.7.1 (Evans SR1)

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Oct 23, 2014

Thomas Darimont commented

Please revise

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Oct 27, 2014

Thomas Darimont commented

I added an example project based on the problem from SO that reproduces the problem and shows that this issue is fixed with the changes in the linked PR.

I couldn't create a unit test that reproduces the problem - any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: bug
Projects
None yet
Development

No branches or pull requests

2 participants