db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1142483 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Date Sun, 03 Jul 2011 19:18:08 GMT
Author: tfischer
Date: Sun Jul  3 19:18:08 2011
New Revision: 1142483

URL: http://svn.apache.org/viewvc?rev=1142483&view=rev
Log:
TORQUE-111: close database connections fo every exception

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1142483&r1=1142482&r2=1142483&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Sun Jul  3 19:18:08 2011
@@ -249,12 +249,15 @@ public class BasePeerImpl implements Ser
                     criteria.isUseTransaction());
             int result = doDelete(criteria, tableName, con);
             Transaction.commit(con);
+            con = null;
             return result;
         }
-        catch (TorqueException e)
+        finally
         {
-            Transaction.safeRollback(con);
-            throw e;
+            if (con != null)
+            {
+                Transaction.safeRollback(con);
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message