[1] seems to be happening now after upgrading the latest Aries JPA 2.3.0 bundles available on maven. [2] shows my aries bundle list.
It appears that when the safeRollback call propagates down to the #finish call
in TransactionAttribute.REQUIRED that the call to TransactionManager#getStatus
does *not* indicate rollback and so a commit attempt is performed.
XAJpaTemplate appears to only set rollback if the exception that occurred
during the TX is either a RuntimeException or Error due to the logic in
XAJpaTemplate#shouldRollback. But if another type of Exception is propagating
then TransactionAttribute.REQUIRED#finish is going to try to commit because
the TX hasn't been marked for rollback.
I would think that any Throwable type should result in a rollback - not just
RuntimeExceptions and Errors. Perhaps XAJpaTemplate#shouldRollback should just
return true?
Does this make sense? Is this a bug?
I'm also not sure why the commit call results in the exception shown - I guess
somehow the thread-local transaction is lost due to the original exception. So
I'm wondering if XAJpaTemplate#safeRollback should log the incoming exception
to assist in the event the original exception is suppressed.
Any assistance is greatly appreciated.
-Matthew Pitts
[1]
java.lang.IllegalStateException: No transaction associated with current thread
at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:249)
at
org.apache.aries.jpa.support.xa.impl.TransactionAttribute$4.finish(TransactionAttribute.java:105)
at
org.apache.aries.jpa.support.impl.XAJpaTemplate.safeFinish(XAJpaTemplate.java:81)
at
org.apache.aries.jpa.support.impl.XAJpaTemplate.safeRollback(XAJpaTemplate.java:101)
at
org.apache.aries.jpa.support.impl.XAJpaTemplate.txExpr(XAJpaTemplate.java:65)
at
com.wellsfargo.nss.osgi.persistence.tx.impl.JpaTemplateTxContext.txExpr(JpaTemplateTxContext.java:30)
at
com.wellsfargo.nss.osgi.persistence.tx.impl.AbstractTxContext.tx(AbstractTxContext.java:19)
[2]
g! lb aries
START LEVEL 100
ID|State |Level|Name
53|Active | 50|Apache Aries JPA Container adapter for EclipseLink
(2.3.0)
59|Active | 50|Apache Aries JPA container (2.3.0)
63|Active | 50|Apache Aries JPA support (2.3.0)
64|Active | 50|Apache Aries Transaction Enlisting JDBC Datasource
(2.1.2.SNAPSHOT)
66|Active | 50|Apache Aries Transaction Manager (1.3.1.SNAPSHOT)
70|Active | 50|Apache Aries Transaction Blueprint (2.1.0)
71|Active | 50|Apache Aries JPA Container API (2.3.0)
114|Active | 20|Apache Aries Blueprint CM (1.0.7)
121|Active | 20|Apache Aries Blueprint API (1.0.1)
123|Active | 20|Guava: Google Core Libraries for Java (15.0.0)
125|Active | 20|Guava: Google Core Libraries for Java (18.0.0)
129|Active | 20|Apache Aries Proxy Bundle (1.0.0)
133|Active | 20|Apache Aries JNDI Support for Legacy Runtimes (1.0.0)
136|Installed | 20|Apache Aries Web Url handler (1.0.0)
143|Active | 20|Apache Aries Blueprint Core (1.4.4)
151|Active | 20|Apache Aries JNDI Core (1.0.2)
155|Active | 20|Apache Aries JNDI API (1.1.0)
158|Active | 20|Apache Aries JNDI URL Handler (1.1.0)
162|Active | 20|Apache Aries Util (1.1.0)
g!
smime.p7s
Description: S/MIME cryptographic signature
