Hi All,
I read in the specs 5.6.1:
A new persistence context begins when the container-managed entity manager is invoked in the scope of an active JTA transaction, and there is no current persistence context already associated with the JTA transaction. The persistence context is created and then associated with the JTA transaction.
and, in the same section:
If the entity manager is invoked outside the scope of a transaction, any entities loaded from the database will immediately become detached at the end of the method call.
In the second case, the persistence context is created too, isn't it ?
So the good answer to "When is a Persistent Context created while using container managed EntityManager?" is
"as soon as an EntityManager is invoked." ?
Thanks for your opinion...
Beno�t