db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1135378 - in /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer: base/doDelete.vm impl/base/doDelete.vm
Date Tue, 14 Jun 2011 03:37:36 GMT
Author: tfischer
Date: Tue Jun 14 03:37:36 2011
New Revision: 1135378

URL: http://svn.apache.org/viewvc?rev=1135378&view=rev
Log:
fix NullPointerException in generated peer methods doDelete(ObjectKey) 

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/doDelete.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doDelete.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/doDelete.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/doDelete.vm?rev=1135378&r1=1135377&r2=1135378&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/doDelete.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/doDelete.vm
Tue Jun 14 03:37:36 2011
@@ -107,7 +107,7 @@
      */
     public static int doDelete(ObjectKey pk) throws TorqueException
     {
-        return ${peerImplGetter}().doDelete(pk, (Connection) null);
+        return ${peerImplGetter}().doDelete(pk);
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doDelete.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doDelete.vm?rev=1135378&r1=1135377&r2=1135378&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doDelete.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/impl/base/doDelete.vm
Tue Jun 14 03:37:36 2011
@@ -129,7 +129,24 @@
      */
     public int doDelete(ObjectKey pk) throws TorqueException
     {
-        return doDelete(pk, (Connection) null);
+        Connection connection = null;
+        try
+        {
+            connection = Transaction.beginOptional(
+                    ${peerClassName}.DATABASE_NAME,
+                    true);
+            int deletedRows = doDelete(pk, connection);
+            Transaction.commit(connection);
+            connection = null;
+            return deletedRows;
+        }
+        finally
+        {
+            if (connection != null)
+            {
+                Transaction.safeRollback(connection);
+            }
+        }
     }
 
     /**



---------------------------------------------------------------------
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