db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r370929 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
Date Fri, 20 Jan 2006 23:36:03 GMT
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;
     }



Mime
View raw message