<div dir="ltr"><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">Sorry, </font>ContextTransactionSynchronizationRegistry is not usable in the way WFLY-11166 contemplated. LocalTransactionContextService wires the <span style="color:rgb(0,0,0)">org.jboss.as.txn.service.inter</span><span style="color:rgb(0,0,0)">nal.tsr.TransactionSynchroniza</span><span style="color:rgb(0,0,0)">tionRegistryWrapper into the builder object that&#39;s meant to drive the org.wildfly.transaction.client stuff but it turns out that object is just discarded, and ContextTransactionSynchronizationRegistry doesn&#39;t use it.</span></div><div class="gmail_default" style=""><span style="color:rgb(0,0,0)"><br></span></div><div class="gmail_default" style=""><span style="color:rgb(0,0,0)">I&#39;ll work up a revert commit.</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 11:10 AM Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com">brian.stansberry@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I suspect this is a bug I introduced in WFLY-11166, which was not meant to change any behavior but perhaps did. I&#39;m having a look.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 10:02 AM Scott Marlow &lt;<a href="mailto:smarlow@redhat.com" target="_blank">smarlow@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 11/15/18 5:39 AM, Tom Jenkinson wrote:<br>
&gt; <br>
&gt; <br>
&gt; On 15 November 2018 at 09:41, Stefano Maestri &lt;<a href="mailto:smaestri@redhat.com" target="_blank">smaestri@redhat.com</a> <br>
&gt; &lt;mailto:<a href="mailto:smaestri@redhat.com" target="_blank">smaestri@redhat.com</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt;     On Wed, Nov 14, 2018 at 10:55 PM Tom Jenkinson<br>
&gt;     &lt;<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a> &lt;mailto:<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;         The JCAOrderedLastSynchronizationList is intended to guarnatee<br>
&gt;         the ordering in the JVM so it seems very likely it should be used.<br>
&gt; <br>
&gt; <br>
&gt;     +1<br>
&gt; <br>
&gt;         I wonder why the wrapper is not being injected into JPA and JCA?<br>
&gt; <br>
&gt; <br>
&gt;     I don&#39;t see any reason in fact. And I don&#39;t remember any issues or<br>
&gt;     discussion specific to this.<br>
&gt; <br>
&gt; <br>
&gt; Hi Scott, I suggest to open a WFLY issue with the details and any <br>
&gt; reproducer you can provide - thanks!<br>
<br>
<a href="https://issues.jboss.org/browse/WFLY-11360" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11360</a> asks the question:<br>
<br>
&quot;<br>
Apparently we are doing a JNDI lookup of <br>
&quot;java:jboss/TransactionSynchronizationRegistry&quot; for Hibernate ORM <br>
integration, which means we are using the <br>
org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper <br>
for Hibernate ORM. Should we also be using the <br>
org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper <br>
class in other WildFly call sites, instead of <br>
org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry?<br>
&quot;<br>
<br>
Responses in the jira are welcome :)<br>
<br>
Scott<br>
<br>
&gt; <br>
&gt; <br>
&gt;     Best,<br>
&gt;     S.<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt;         On 14 November 2018 at 17:34, Scott Marlow &lt;<a href="mailto:smarlow@redhat.com" target="_blank">smarlow@redhat.com</a><br>
&gt;         &lt;mailto:<a href="mailto:smarlow@redhat.com" target="_blank">smarlow@redhat.com</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;             Hi,<br>
&gt; <br>
&gt;             I made a local change to JCAOrderedLastSynchronizationList,<br>
&gt;             to have the<br>
&gt;             JPA container (TransactionUtil$SessionSynchronization)<br>
&gt;             afterCompletion()<br>
&gt;             always be run after Hibernate afterCompletion() but before<br>
&gt;             the JCA<br>
&gt;             afterCompletion().  As I am implementing EntityManager<br>
&gt;             caching [1] and<br>
&gt;             want to ensure that the EntityManager instances are only<br>
&gt;             returned to the<br>
&gt;             cache after the EntityManager is expected to be available<br>
&gt;             for reuse.<br>
&gt; <br>
&gt;             In my debugging, I noticed that the<br>
&gt;             JCAOrderedLastSynchronizationList<br>
&gt;             only has the Hibernate synchronizations being added but not<br>
&gt;             the JCA or<br>
&gt;             JPA container synchronizations.  [2] shows that the JCA + JPA<br>
&gt;             Synchronizations are registered via<br>
&gt;             org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry<br>
&gt; <br>
&gt;             and Hibernate ORM Synchronization is registered via the<br>
&gt;             org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper<br>
&gt; <br>
&gt;             Should<br>
&gt;             org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry<br>
&gt; <br>
&gt;             be changed to use JCAOrderedLastSynchronizationList as well,<br>
&gt;             so that<br>
&gt;             IronJacamar (JCA) Synchronizations are run in the correct order?<br>
&gt; <br>
&gt;             Should we change the JPA subsystem/container to also ensure<br>
&gt;             that<br>
&gt;             Hibernate ORM 5.3 uses the<br>
&gt;             ContextTransactionSynchronizationRegistry<br>
&gt;             instead of the<br>
&gt;             org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper?<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt;             Is there a WildFly service that represents the<br>
&gt;             org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry<br>
&gt; <br>
&gt;             lifecycle?  The JPA persistence unit service (or global JPA<br>
&gt;             service)<br>
&gt;             should depend on that service, so that applications undeploy<br>
&gt;             if the TSR<br>
&gt;             is stopped.<br>
&gt; <br>
&gt;             [3] is also related to the the [1] effort and would be<br>
&gt;             impacted by the<br>
&gt;             above mentioned changes.<br>
&gt; <br>
&gt;             Scott<br>
&gt; <br>
&gt;             [1] EntityManager caching<br>
&gt;             <a href="https://issues.jboss.org/browse/WFLY-11233" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11233</a><br>
&gt;             &lt;<a href="https://issues.jboss.org/browse/WFLY-11233" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11233</a>&gt;<br>
&gt; <br>
&gt;             [2]<br>
&gt;             <a href="https://paste.fedoraproject.org/paste/-wHaYB3mzR2yTXTfU3LbZA" rel="noreferrer" target="_blank">https://paste.fedoraproject.org/paste/-wHaYB3mzR2yTXTfU3LbZA</a><br>
&gt;             &lt;<a href="https://paste.fedoraproject.org/paste/-wHaYB3mzR2yTXTfU3LbZA" rel="noreferrer" target="_blank">https://paste.fedoraproject.org/paste/-wHaYB3mzR2yTXTfU3LbZA</a>&gt;<br>
&gt; <br>
&gt;             [3] Ensure that Hibernate uses direct reference to TSR for<br>
&gt;             better<br>
&gt;             performance <a href="https://issues.jboss.org/browse/WFLY-11243" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11243</a><br>
&gt;             &lt;<a href="https://issues.jboss.org/browse/WFLY-11243" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11243</a>&gt;<br>
&gt;             _______________________________________________<br>
&gt;             wildfly-dev mailing list<br>
&gt;             <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;             <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;             &lt;<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a>&gt;<br>
&gt; <br>
&gt; <br>
&gt;         _______________________________________________<br>
&gt;         wildfly-dev mailing list<br>
&gt;         <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;         <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
&gt;         &lt;<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a>&gt;<br>
&gt; <br>
&gt; <br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-7694753467469155736gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Brian Stansberry<div>Manager, Senior Principal Software Engineer</div><div>Red Hat</div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Brian Stansberry<div>Manager, Senior Principal Software Engineer</div><div>Red Hat</div></div></div>