You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2011/07/03 21:18:08 UTC

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

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