OPENJPA-389 et.commit() not issuing database commit for Native queries involving updates.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@581088 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2007-10-01 21:50:15 +00:00
parent 5a48e90100
commit fab1a92046

View File

@ -215,6 +215,9 @@ public class SQLStoreQuery
paramList = Collections.EMPTY_LIST;
SQLBuffer buf = new SQLBuffer(dict).append(sql);
// we need to make sure we have an active store connection
store.getContext().beginStore();
Connection conn = store.getConnection();
JDBCFetchConfiguration fetch = (JDBCFetchConfiguration)
q.getContext().getFetchConfiguration();
@ -241,6 +244,8 @@ public class SQLStoreQuery
try { stmnt.close(); } catch (SQLException se2) {}
try { conn.close(); } catch (SQLException se2) {}
throw SQLExceptions.getStore(se, dict);
} finally {
try { conn.close(); } catch (SQLException se) {}
}
}