Page 1 of 1

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

Posted: Sun Jul 20, 2014 4:05 am
by ramy6_1
Hello ,

In your explanation (In the four option) you mentioned:

"An application managed persistence context (which is always an extended persistence context) "

But application manged persistence context is different than extended persistence context.

application manged persistence context : the persistence context here managed by the application.

extended persistence context : the persistence context here is managed by the container.

As you know container managed persistence context can be one of two types : transaction which is the default and extended.

Please explain

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

Posted: Sun Jul 20, 2014 4:36 am
by admin
The explanation is correct. There are two orthogonal categories of contexts - scope wise (i.e. transaction scoped and extended) and management wise (i.e. application managed and container managed).

Application managed context's scope is always extended (which is what the statement in the explanation says). While container managed context's scope can be extended or transaction.

HTH,
Paul.

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

Posted: Sun Aug 30, 2015 12:31 pm
by romsky
The explanation for first variant is not complete.
==
The extended persistence context exists from the point at which the entity manager has been created using EntityManagerFactory.createEntityManager until the entity manager is closed by means of EntityManager.close.
==

That is true for application managed extended persistence context, but not for container-managed one.

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

Posted: Sun Aug 30, 2015 8:27 pm
by admin
This short explanation is only to show a case that proves the statement wrong. It has now been enhance to show both possibilities. The details for both kinds of extended persistence context are given at the end of the question.

thank you for your feedback!