[jboss-as7-dev] Switch to use TransactionSynchronizationRegistry.registerInterposedSynchronization?

Stuart Douglas stuart.w.douglas at gmail.com
Wed Jun 1 17:45:28 EDT 2011


Seam 2 or Seam 3?

Seam 2 registers it's synchronisations using an EJB that holds onto the synchronisations and calling them in the appropriate EJB callback method, so this should have a minimal effect.

Seam 3 currently uses the TransactionManager, however the strategy used is pluggable. Originally it used the same approach as Seam 2, however it was changed to work around an AS6 bug where
the same EJB could not be deployed in two different applications. If this does cause problems I will do a point release that provides an AS7 compatible synchronisations implementation. 

Stuart

On 02/06/2011, at 6:05 AM, Scott Marlow wrote:

> I cross posted a link to this email, on the Hibernate-dev/Infinispan-dev 
> project mail lists.
> 
> Can anyone answer on the impact on seam, if we switched to using TSR in AS7?
> 
> 
> On 05/31/2011 04:06 PM, Scott Marlow wrote:
>> We are supposed to be able to use
>> TransactionSynchronizationRegistry.registerInterposedSynchronization
>> (TSR) in our containers but I wanted to bring up an ordering issue that
>> can happen.
>> 
>> If you look at http://pastie.org/1836698, you can see what happened when
>> Hibernate registered a synchronization object with the TSR and we tried
>> after to get a database connection from the connection pool.
>> 
>> Basically, once a synchronization object is registered with the TSR, the
>> other way of registering a synchronization object through the
>> Transaction registerSynchronization() cannot be used (or you get the
>> above linked IllegalStateException error).
>> 
>> The short term fix was to avoid registering Hibernate with the TSR and
>> instead use the Transaction registerSynchronization().  This helped
>> avoid the ISE exception as the TSR sync ordering check is avoided.
>> 
>> The Transaction registerSynchronization(), has no ordering requirements
>> but as we have seen, the TSR registerInterposedSynchronization does.
>> 
>> I think we need to be consistent across our projects and either use TSR
>> or avoid it (to avoid the "Synchronizations are not allowed!" JTA
>> error).  If/when we use it, we need to coordinate the switch over to it,
>> so that all projects have time to switch to it.
>> 
>> I'm hoping someone will tell me that there is an easier path to use TSR
>> registerInterposedSynchronization in some of our projects.  What do you
>> think?
>> 
>> The other question, is how/when we should we coordinate a switch over to
>> use TSR (assuming there is agreement that we should coordinate the switch)?
>> 
>> Scott
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
> 
> _______________________________________________
> 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