cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1417976 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/tx/DefaultTransactionManager.java
Date Thu, 06 Dec 2012 16:21:41 GMT
Author: aadamchik
Date: Thu Dec  6 16:21:40 2012
New Revision: 1417976

URL: http://svn.apache.org/viewvc?rev=1417976&view=rev
Log:
CAY-1778 TransactionManager to simplify user-managed transactions

... and of course we should not forget to commit

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/tx/DefaultTransactionManager.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/tx/DefaultTransactionManager.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/tx/DefaultTransactionManager.java?rev=1417976&r1=1417975&r2=1417976&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/tx/DefaultTransactionManager.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/tx/DefaultTransactionManager.java
Thu Dec  6 16:21:40 2012
@@ -47,7 +47,13 @@ public class DefaultTransactionManager i
         Transaction tx = dataDomain.createTransaction();
         Transaction.bindThreadTransaction(tx);
         try {
-            return op.perform();
+
+            T result = op.perform();
+
+            tx.commit();
+
+            return result;
+
         } catch (Exception ex) {
             tx.setRollbackOnly();
             throw new CayenneRuntimeException(ex);
@@ -57,7 +63,7 @@ public class DefaultTransactionManager i
             if (tx.getStatus() == Transaction.STATUS_MARKED_ROLLEDBACK) {
                 try {
                     tx.rollback();
-                } catch (Exception rollbackEx) {
+                } catch (Exception e) {
                 }
             }
         }



Mime
View raw message