mirror of https://github.com/apache/openjpa.git
OPENJPA-543
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@640511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2d0a3c9157
commit
9dadffffc1
|
@ -231,14 +231,24 @@ public class SQLStoreQuery
|
||||||
buf.setParameters(stmnt);
|
buf.setParameters(stmnt);
|
||||||
|
|
||||||
int count = executeUpdate(store, conn, stmnt, buf);
|
int count = executeUpdate(store, conn, stmnt, buf);
|
||||||
|
|
||||||
return Numbers.valueOf(count);
|
return Numbers.valueOf(count);
|
||||||
} catch (SQLException se) {
|
} catch (SQLException se) {
|
||||||
if (stmnt != null)
|
|
||||||
try { stmnt.close(); } catch (SQLException se2) {}
|
|
||||||
try { conn.close(); } catch (SQLException se2) {}
|
|
||||||
throw SQLExceptions.getStore(se, dict);
|
throw SQLExceptions.getStore(se, dict);
|
||||||
} finally {
|
} 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) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue