For the extended persistence context, the JTA transaction should still start and end on the same thread.

For EE container managed transaction scoped persistence contexts, the container has a worse problem (I think), in that the EntityManager.close() must be called after the JTA transaction ends.  So, there is no "next" invocation event to depend on.  I haven't looked into the code change yet but am curious about adding AS/platform level instrumentation that is triggered in the application thread, via Transaction interceptor that is responsible for starting/ending transaction.  This is essentially the idea that was discussed in the as7-dev mailing list thread but is not proven yet.  Anyway, if we had a transaction interceptor class in AS code, that could check if an afterCompletion occurred in a non-app thread and would trigger the afterCompletion in the app thread (or something logically the same), if that would be good enough to handle clearing the entity manager after a tx timeout also.