private Collection flush(Collection states, JDBCStore store,
PreparedStatementManager psMgr) {
RowManager rowMgr = newRowManager();
Collection customs = new LinkedList();
Collection exceps = null;
for (Iterator itr = states.iterator(); itr.hasNext();)
exceps = populateRowManager((OpenJPAStateManager) itr.next(),
rowMgr, store, exceps, customs);
exceps = flush(rowMgr, psMgr, exceps);
for (Iterator itr = customs.iterator(); itr.hasNext();) {
try {
((CustomMapping) itr.next()).execute(store);
} catch (SQLException se) {
exceps = addException(exceps, SQLExceptions.getStore(se, dict));
} catch (OpenJPAException ke) {
exceps = addException(exceps, ke);
}
}
Collection psExceps = psMgr.getExceptions();
if (exceps == null)
return psExceps;
if (psExceps == null)
return exceps;
exceps.addAll(psExceps);
return exceps;
}