<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 15:09, Scott Marlow wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 06/02/2011 09:50 AM, Mircea Markus wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 2 Jun 2011, at 13:19, Scott Marlow wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">On 06/02/2011 05:31 AM, Mircea Markus wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On 1 Jun 2011, at 20:49, Scott Marlow wrote:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I posted a message on the as7-dev ml<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><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></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">about switching to use the TransactionSynchronizationRegistry.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Does Infinispan currently register Transaction synchronization objects?<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">yes<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;Does Infinispan currently register synchronizations via<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">TransactionSynchronizationRegistry (TSR)?<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">no, we register synchronizations through transaction.registerSynchronization<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'm trying to get a sense for, what would happen if container managed<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">(AS7) session beans were registered with the active JTA transaction via<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">the TSR.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">If AS7 switches to use the TSR, I think that Infinispan might need to<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ensure that it doesn't attempt to register with the TX too late.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">right. One way to go &nbsp;is by making the registration code pluggable.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">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></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">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></blockquote></blockquote><blockquote type="cite">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.<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">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></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">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.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> From Jonathan's comment[1] I understand that "interposed Synchronizations must be called after non-interposed ones". That seems to be true disregarding tx's status. Or am I wrong?<br></blockquote><br>Jonathan also commented here a few minutes ago, with further clarification of the exact rules. &nbsp;Best to read what he said directly (he described the situation in much better detail than me). <a href="http://lists.jboss.org/pipermail/jboss-as7-dev/2011-June/002275.html">http://lists.jboss.org/pipermail/jboss-as7-dev/2011-June/002275.html</a><br><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><blockquote type="cite"><div>Copying from his email:<br><br>"<br>So, the rule for activity in beforeCompletion is:<br><br> &nbsp;- a Sync registered via registerSynchronization may call either registerSynchronization or registerInterposedSynchronization.<br><br> &nbsp;- a Sync registered via registerInterposedSynchronization may call only registerInterposedSynchronization.<br>"<br></div></blockquote>Thanks for the clarification. The Syncs we register do not do any subsequent Sync registration in&nbsp;beforeCompletion so should be on the safe side.&nbsp;</div></body></html>