spring-projects / spring-projects/spring-data-jpa
Transaction marked as rollback only when initialising application when working with transaction manager [DATAJPA-1686]
@schauder is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 3.3k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
mirackle-spb opened DATAJPA-1686 and commented
Looks like DATAJPA-617 is not completely resolved. My app doing some data work while context initialisation is in progress. Inserting default data to database. When it initialising it depends on JpaReposiotory. When spring tries to initialise Repository spring-data-jpa make check for existence of named queries.
Within NamedQuery.javaa when lookupEm.createNamedQuery is called. Later Hibernate in AbstractSharedSessionContract query is not found and exceprion is fired. Hibernate ExceptionConverterImpl fire markForRollbackOnly.
Spring-data catches this exception but it is not matter at this point. Transaction is already marked.
Problem reproduced in 100% of cases when JTA transaction manager is in use
Affects: 2.2.4 (Moore SR4)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.