- Posts: 11
- Joined: Thu May 05, 2016 2:50 am
Regarding the explanation of application managed extended persistence context:
An extended persistence context obtained from the application-managed entity manager is a stand-alone persistence context—it is not propagated with the transaction.
but from JPA 2.0 spec:
An application-managed entity manager may be either a JTA entity manager or a resource-local entity
The persistence context is propagated across the entity manager instances as the JTA transaction is
If an entity manager is then invoked from within the component:
- Invocation of an entity manager defined with PersistenceContext-
Type.EXTENDED will result in the use of the existing extended persistence context
bound to that component.
If a component is called and the JTA transaction is propagated into that component:
- if there is a persistence context bound to the JTA transaction, that persistence con-
text is propagated and used
Can we conclude that it will be propagated with the transaction (if the JTA transaction is propagated)?
- Site Admin
- Posts: 7552
- Joined: Fri Sep 10, 2010 9:26 pm
No, the propagation that is being talked about here is to different components of a distributed application i.e. to different process spaces (and not about propagating it to a different component within the same process space).
Section 7.7 of the JPA 2.0 spec clearly says, "An extended persistence context obtained from the application-managed entity manager is a stand-alone persistence context—it is not propagated with the transaction."
In a distributed application, the transaction will propagate across process boundaries but not the persistence context.
If you like our products and services, please help us by posting your review here
Users browsing this forum: No registered users and 3 guests