users@jpa-spec.java.net

[jpa-spec users] [jsr338-experts] Re: transaction-scoped persistence context being closed at JTA transaction completion time from non-application thread ...

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Thu, 14 Mar 2013 14:03:57 -0700

I have added the proposed language to the spec.


On 3/13/2013 12:10 PM, Scott Marlow wrote:

>
> For 7.9.1, how about something like:
>
> "
> After the JTA transaction has completed (either by transaction commit or rollback), the container closes the entity
> manager by calling EntityManager.close. The JTA transaction may rollback in a background thread (e.g. transaction
> timeout), in which case, the container should arrange for the entity manager to be closed but the EntityManager.close()
> should not be concurrently called while the application is in an EntityManager invocation.
> "
>
> The 7.9.2 wording can be similar I think:
> "
> When the JTA transaction rolls back, the provider must detach all managed entities if the persistence context is of type
> SynchronizationType.SYNCHRONIZED or has otherwise been joined to the transaction. The JTA transaction may rollback in a
> background thread (e.g. transaction timeout), in which case, the provider should arrange for the managed entities to be
> detached from the persistence context but not concurrently while the application is in an EntityManager invocation.
> "
>