On 11/25/2011 11:09 AM, Scott Marlow wrote:
> Could we change 7.6.2 Container-managed Transaction-scoped Persistence
> Context to be more clear in the following paragraph:
>
> "
> 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.
> "
>
> Which method call do we mean exactly? I think we mean each entity
> manager call (e.g. EntityManager.find). Perhaps changing to:
>
> "
> 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 entity manager method call.
> "
I probably have interpreted the wording incorrectly, I think it should
be at the end of the container level method invocation. All the more
reason to be explicit with the wording. ;)
>
> Which rules out other possible interpretations of which method is
> referred to.
>
> Related to this, could the previous paragraph:
>
> "
> The persistence context ends when the associated JTA transaction commits
> or rolls back, and all entities that were managed by the EntityManager
> become detached.[80]
> "
>
> Also be made more specific about when the persistence context ends for
> the transaction scoped entity manager that is invoked outside of a JTA
> transaction. Detaching the loaded entities is different than closing the
> persistence context.
>
> Perhaps we could cover this with an additional change to the last
> paragraph in this 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 entity manager method call. The persistence context may
> end after each entity manager method call (some implementations could
> release the persistence context at the end of the container invocation).
> "
>
> Scott