OPENJPA-543

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@640511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2008-03-24 18:41:12 +00:00
parent 2d0a3c9157
commit 9dadffffc1
1 changed files with 15 additions and 5 deletions

View File

@ -230,15 +230,25 @@ public class SQLStoreQuery
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) {
}
}
}