[jboss-as7-dev] Switch to use TransactionSynchronizationRegistry.registerInterposedSynchronization?
Scott Marlow
smarlow at redhat.com
Wed Jun 1 16:05:25 EDT 2011
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
More information about the jboss-as7-dev
mailing list