<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 14, 2018 at 10:55 PM Tom Jenkinson &lt;<a href="mailto:tom.jenkinson@redhat.com">tom.jenkinson@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">The 
JCAOrderedLastSynchronizationList is intended to guarnatee the ordering in the JVM so it seems very likely it should be used.</div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">+1</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"> I wonder why the wrapper is not being injected into JPA and JCA?<br></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I don&#39;t see any reason in fact. And I don&#39;t remember any issues or discussion specific to this.</div><div class="gmail_default" style="font-size:small"></div><br></div><div><div class="gmail_default" style="font-size:small">Best,</div><div class="gmail_default" style="font-size:small">S.</div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"></div><div class="gmail_extra"><br><div class="gmail_quote">On 14 November 2018 at 17:34, Scott Marlow <span dir="ltr">&lt;<a href="mailto:smarlow@redhat.com" target="_blank">smarlow@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I made a local change to JCAOrderedLastSynchronizationList, to have the <br>
JPA container (TransactionUtil$SessionSynchronization) afterCompletion() <br>
always be run after Hibernate afterCompletion() but before the JCA <br>
afterCompletion().  As I am implementing EntityManager caching [1] and <br>
want to ensure that the EntityManager instances are only returned to the <br>
cache after the EntityManager is expected to be available for reuse.<br>
<br>
In my debugging, I noticed that the JCAOrderedLastSynchronizationList <br>
only has the Hibernate synchronizations being added but not the JCA or <br>
JPA container synchronizations.  [2] shows that the JCA + JPA <br>
Synchronizations are registered via <br>
org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry <br>
and Hibernate ORM Synchronization is registered via the <br>
org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper<br>
<br>
Should <br>
org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry <br>
be changed to use JCAOrderedLastSynchronizationList as well, so that <br>
IronJacamar (JCA) Synchronizations are run in the correct order?<br>
<br>
Should we change the JPA subsystem/container to also ensure that <br>
Hibernate ORM 5.3 uses the ContextTransactionSynchronizationRegistry <br>
instead of the <br>
org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper? <br>
<br>
<br>
Is there a WildFly service that represents the <br>
org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry <br>
lifecycle?  The JPA persistence unit service (or global JPA service) <br>
should depend on that service, so that applications undeploy if the TSR <br>
is stopped.<br>
<br>
[3] is also related to the the [1] effort and would be impacted by the <br>
above mentioned changes.<br>
<br>
Scott<br>
<br>
[1] EntityManager caching <a href="https://issues.jboss.org/browse/WFLY-11233" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11233</a><br>
<br>
[2] <a href="https://paste.fedoraproject.org/paste/-wHaYB3mzR2yTXTfU3LbZA" rel="noreferrer" target="_blank">https://paste.fedoraproject.org/paste/-wHaYB3mzR2yTXTfU3LbZA</a><br>
<br>
[3] Ensure that Hibernate uses direct reference to TSR for better <br>
performance <a href="https://issues.jboss.org/browse/WFLY-11243" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/WFLY-11243</a><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><br>
</blockquote></div><br></div>
_______________________________________________<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></div>