public Collection flush(Collection states, JDBCStore store) { Connection conn = store.getConnection(); try { PreparedStatementManager psMgr = newPreparedStatementManager(store, conn); return flush(states, store, psMgr); } finally { try { conn.close(); } catch (SQLException se) {} } }
public Collection flush(Collection states, JDBCStore store) { Connection conn = store.getConnection(); try { PreparedStatementManager psMgr = newPreparedStatementManager(store, conn); return flush(states, store, psMgr); } finally { try { conn.close(); } catch (SQLException se) {} } }
public Collection flush(Collection states, JDBCStore store) { Connection conn = store.getConnection(); try { PreparedStatementManager psMgr = newPreparedStatementManager(store, conn); return flush(states, store, psMgr); } finally { try { conn.close(); } catch (SQLException se) {} } }
public Collection flush(Collection states, JDBCStore store) { Connection conn = store.getConnection(); try { PreparedStatementManager psMgr = newPreparedStatementManager(store, conn); return flush(states, store, psMgr); } finally { try { conn.close(); } catch (SQLException se) {} } }
public Collection flush(Collection states, JDBCStore store) { Connection conn = store.getConnection(); try { PreparedStatementManager psMgr = newPreparedStatementManager(store, conn); return flush(states, store, psMgr); } finally { try { conn.close(); } catch (SQLException se) {} } }
private Collection flush(Collection states, JDBCStore store, PreparedStatementManager psMgr) { // run through all the states and update them as necessary 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); // flush rows exceps = flush(rowMgr, psMgr, exceps); // now do any custom mappings 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); } } // return all exceptions Collection psExceps = psMgr.getExceptions(); if (exceps == null) return psExceps; if (psExceps == null) return exceps; exceps.addAll(psExceps); return exceps; }