About Question enthuware.oce-jpad.v6.2.457 :

Moderator: admin

Post Reply
dfigueira
Posts: 21
Joined: Thu May 05, 2016 2:50 am
Contact:

About Question enthuware.oce-jpad.v6.2.457 :

Post by dfigueira »

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
manager.
The persistence context is propagated across the entity manager instances as the JTA transaction is
propagated.
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)?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.457 :

Post by admin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests