aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1704643 - in /aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl: AbstractJpaTemplate.java ResourceLocalJpaTemplate.java XAJpaTemplate.java
Date Tue, 22 Sep 2015 14:40:09 GMT
Author: cschneider
Date: Tue Sep 22 14:40:07 2015
New Revision: 1704643

URL: http://svn.apache.org/viewvc?rev=1704643&view=rev
Log:
[ARIES-1415] Do not wrap RuntimeException instances

Modified:
    aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/AbstractJpaTemplate.java
    aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/ResourceLocalJpaTemplate.java
    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/AbstractJpaTemplate.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/AbstractJpaTemplate.java?rev=1704643&r1=1704642&r2=1704643&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/AbstractJpaTemplate.java
(original)
+++ aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/AbstractJpaTemplate.java
Tue Sep 22 14:40:07 2015
@@ -47,4 +47,11 @@ public abstract class AbstractJpaTemplat
         tx(TransactionType.Required, code);
     }
 
+
+    protected RuntimeException wrapThrowable(Throwable ex) {
+        if (ex instanceof RuntimeException) {
+            return (RuntimeException) ex;
+        }
+        return new RuntimeException(ex);
+    }
 }

Modified: aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/ResourceLocalJpaTemplate.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/ResourceLocalJpaTemplate.java?rev=1704643&r1=1704642&r2=1704643&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/ResourceLocalJpaTemplate.java
(original)
+++ aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/ResourceLocalJpaTemplate.java
Tue Sep 22 14:40:07 2015
@@ -59,7 +59,7 @@ public class ResourceLocalJpaTemplate ex
             if (weControlTx) {
                 safeRollback(em, e);
             }
-            throw new RuntimeException(e);
+            throw wrapThrowable(e);
         } finally {
             coord.end();
         }

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=1704643&r1=1704642&r2=1704643&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
Tue Sep 22 14:40:07 2015
@@ -62,7 +62,7 @@ public class XAJpaTemplate extends Abstr
             return result;
         } catch (Throwable ex) {
             safeRollback(tranToken, ex);
-            throw new RuntimeException(ex);
+            throw wrapThrowable(ex);
         } finally {
             try {
                 ta.finish(tm, tranToken);



Mime
View raw message