openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r640510 - /openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
Date Mon, 24 Mar 2008 18:40:51 GMT
Author: mikedd
Date: Mon Mar 24 11:40:47 2008
New Revision: 640510

URL: http://svn.apache.org/viewvc?rev=640510&view=rev
Log:
OPENJPA-543

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java?rev=640510&r1=640509&r2=640510&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
Mon Mar 24 11:40:47 2008
@@ -239,11 +239,18 @@
                 }
                 return Numbers.valueOf(count);
             } catch (SQLException se) {
-                if (stmnt != null)
-                    try { stmnt.close(); } catch (SQLException se2) {}
-                try { conn.close(); } catch (SQLException se2) {}
                 throw SQLExceptions.getStore(se, dict);
             } finally {
+                if(stmnt != null) {
+                    try {
+                        stmnt.close(); 
+                    } catch (SQLException se) {
+                        // safe to ignore, we're just cleaning up.
+                    }
+                    finally {
+                        stmnt = null;
+                    }
+                }
                 try { conn.close(); } catch (SQLException se) {}
             }
         }



Mime
View raw message