aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1702511 - /aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java
Date Fri, 11 Sep 2015 16:22:19 GMT
Author: cschneider
Date: Fri Sep 11 16:22:19 2015
New Revision: 1702511

URL: http://svn.apache.org/r1702511
Log:
[ARIES-1393] Only join transaction if it is present

Modified:
    aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java

Modified: aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java?rev=1702511&r1=1702510&r2=1702511&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java
(original)
+++ aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/XAJpaTemplate.java
Fri Sep 11 16:22:19 2015
@@ -19,6 +19,7 @@
 package org.apache.aries.jpa.support.impl;
 
 import javax.persistence.EntityManager;
+import javax.transaction.Status;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
@@ -54,7 +55,9 @@ public class XAJpaTemplate extends Abstr
             tranToken = ta.begin(tm);
             coord = coordinator.begin(this.getClass().getName(), 0);
             em = emSupplier.get();
-            em.joinTransaction();
+            if (tm.getStatus() != Status.STATUS_NO_TRANSACTION) {
+                em.joinTransaction();
+            }
             R result = (R)code.apply(em);
             return result;
         } catch (Throwable ex) {



Mime
View raw message