<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 2 Jun 2011, at 13:19, Scott Marlow wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 06/02/2011 05:31 AM, Mircea Markus wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 1 Jun 2011, at 20:49, Scott Marlow wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">I posted a message on the as7-dev ml<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(<a href="http://lists.jboss.org/pipermail/jboss-as7-dev/2011-May/002254.html">http://lists.jboss.org/pipermail/jboss-as7-dev/2011-May/002254.html</a>),<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">about switching to use the TransactionSynchronizationRegistry.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Does Infinispan currently register Transaction synchronization objects?<br></blockquote></blockquote><blockquote type="cite">yes<br></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;Does Infinispan currently register synchronizations via<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">TransactionSynchronizationRegistry (TSR)?<br></blockquote></blockquote><blockquote type="cite">no, we register synchronizations through transaction.registerSynchronization<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I'm trying to get a sense for, what would happen if container managed<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(AS7) session beans were registered with the active JTA transaction via<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">the TSR.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">If AS7 switches to use the TSR, I think that Infinispan might need to<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">ensure that it doesn't attempt to register with the TX too late.<br></blockquote></blockquote><blockquote type="cite">right. One way to go &nbsp;is by making the registration code pluggable.<br></blockquote><br>I should point out that I believe its only a problem, to call Transaction.registerSynchronization() after the point, where the ordering cannot be correct. &nbsp;However, no such checking is performed if no components are registering their syncs via TransactionSynchronizationRegistry.<br><br>So, another question, how likely would it be, that an application would see Infinispan registering a sync via Transaction.registerSynchronization(), after the transaction commit has been initiated?<br></div></blockquote>ATM Infinispan allows the registration if the transaction is in one of the following states: Status.STATUS_ACTIVE || Status.STATUS_PREPARING. If tx is in any other state the sync won't be registered and a exception is instead sent to the user.&nbsp;&nbsp;</div><div><blockquote type="cite"><div><br>If Transaction.registerSynchronization() will always be called by Infinispan before the transaction commits. &nbsp;We shouldn't have to be as concerned about support for registering the Infinispan syncs with TransactionSynchronizationRegistry.<br></div></blockquote></div><div><blockquote type="cite"><div><br>If the answer is we aren't sure or Transaction.registerSynchronization() could happen after the transaction commit has been started, we should have it be pluggable.</div></blockquote><div><br></div><div><div>From Jonathan's comment[1] I understand that "<span class="Apple-style-span" style="font-family: arial, FreeSans, Helvetica, sans-serif; font-size: 14px; line-height: 20px; ">interposed Synchronizations must be called after non-interposed ones</span>". That seems to be true disregarding tx's status.&nbsp;Or am I wrong?</div><div><blockquote type="cite"></blockquote></div></div><div>[1]&nbsp;<a href="http://bit.ly/lAJKvm">http://bit.ly/lAJKvm</a></div><br></div><br></body></html>