openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r640511 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
Date Mon, 24 Mar 2008 18:41:14 GMT
Author: mikedd
Date: Mon Mar 24 11:41:12 2008
New Revision: 640511

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

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java?rev=640511&r1=640510&r2=640511&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
Mon Mar 24 11:41:12 2008
@@ -230,15 +230,25 @@
                 if (stmnt != null)
                     buf.setParameters(stmnt);
 
-                int count = executeUpdate(store, conn, stmnt, buf);                
+                int count = executeUpdate(store, conn, stmnt, buf);  
+              
                 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 {
-                try { conn.close(); } catch (SQLException se) {}
+                if (stmnt != null) {
+                    try {
+                        stmnt.close();
+                    } catch (SQLException se) {
+                        // safe to ignore
+                    } finally {
+                        stmnt = null;
+                    }
+                }
+                try {
+                    conn.close();
+                } catch (SQLException se) {
+                }
             }
         }
 



Mime
View raw message