You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JavaDoc on its start() and stop() method states that nothing should happen if service is already started or stopped respectively. However, trying to call those methods twice results in an IllegalStateException being thrown by the implementation due to these checks:
publicsynchronizedvoidstart() {
Preconditions.checkState(null == emFactory, "Persistence service was already initialized.");
...
}
publicsynchronizedvoidstop() {
Preconditions.checkState(emFactory.isOpen(), "Persistence service was already shut down.");
....
The text was updated successfully, but these errors were encountered:
This modification continues work of Andreas Viedma
(andresviedma:unitofwork-annotation).
Current solution of the EntityManager doesn't robustly support use of
Transaction scoped EntityManager.If EntityManager is injected or
emProvider.get() is called outside of the Transactional annotation,
then this will lead to never closed EntityManager. (Current solution
would need boilerplate UnitOfWork.end() calls). This behaviour is also
different than in Guice 2.0 with warp-persist, where Transaction scoped
EntityManager works.
With this commit UnitOfWork and EntityManager are separated.
This means that getting of EntityManager doesn't start UnitOfWork.
If EntityManager scope needs to be different than transaction,
UnitOfWork has to be explicitly started.UnitOfWork can be started
with annotation or explicitly calling begin(). Annotation supports
nested UnitOfWorks. If begin is called directly from UnitOfWork then
it requires direct call to end() to end UnitOfWork.End call will always
end UnitOfWork.
Resolves issues: google#739, google#947
The JavaDoc on its
start()
andstop()
method states that nothing should happen if service is already started or stopped respectively. However, trying to call those methods twice results in an IllegalStateException being thrown by the implementation due to these checks:The text was updated successfully, but these errors were encountered: