[jboss-as7-dev] JTA Synchronization.afterCompletion callback can occur in a background thread but JPA EntityManager must be accessed in single-threaded manner...

Scott Marlow smarlow at redhat.com
Mon Mar 18 11:20:55 EDT 2013


On 03/15/2013 04:07 PM, Scott Marlow wrote:
> [1] contains the updated JPA 2.1 specification requirements for when the
> JTA transaction times out from a background thread.
>
> AS7-6586 [2] will address the [1] requirements for AS8 and will be a
> candidate for back-porting as needed.  For the container side, knowing
> if we are in the "Transaction Reaper Worker N" thread would be helpful
> (by checking thread name or via a JBossTM spi).  I don't like the idea
> of checking the thread name but also don't have the
> (isCurrentThreadTheReaper()) spi in hand currently.

I created JBTM-1556 for adding a JBossTM/JBossTS way to know if the 
current thread is the reaper.


>
> The Hibernate team already has committed the provider side fix [3].
>
> [1]
> http://java.net/projects/jpa-spec/lists/jsr338-experts/archive/2013-03/message/38
>
> [2] AS7-6586 - "JPA afterCompletion sync may be called from
> non-application thread, resolve concurrency concern"
>
> [3] HHH-7910 - "Transaction timeout can cause non-threadsafe session
> access by reaper thread"
>
> Scott
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>



More information about the jboss-as7-dev mailing list