You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by mv...@apache.org on 2006/01/21 00:36:03 UTC

svn commit: r370929 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java

Author: mvdb
Date: Fri Jan 20 15:35:56 2006
New Revision: 370929

URL: http://svn.apache.org/viewcvs?rev=370929&view=rev
Log:
Close statement and connection as the javadoc say it does. Also prevent a possible memory leak by moving it to the finally block.

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java?rev=370929&r1=370928&r2=370929&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java Fri Jan 20 15:35:56 2006
@@ -747,10 +747,12 @@
         }
         catch (SQLException ex)
         {
-            // any other exception comes from the iterator which closes the resources automatically
+            throw new DynaSqlException("Error while fetching data from the database", ex);
+        } 
+        finally 
+        {
             closeStatement(statement);
             returnConnection(connection);
-            throw new DynaSqlException("Error while fetching data from the database", ex);
         }
         return result;
     }