@Inject EntityManager outside @Transactional creates stale connections
Open
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 1.7k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
[stackoverflow](http://stackoverflow.com) handles this issue in a three year old post, but the implementation is still the same;
[ Lifecycle management of EntityManager is kind of broken if it's injected via @Inject EntityManager](http://stackoverflow.com/questions/18101488/does-guice-persist-provide-transaction-scoped-or-application-managed-entitymanag). Check answer 7 and 16.
There should be a safety check for transaction-scoped semantics which prevents EntityManager instances outside @Transactional methods.
Contributor guide
Assessment
This issue has not been assessed yet.