/** * {@inheritDoc} */ @Override public void store(Object o) throws ObjectStoreException { Connection c = null; try { c = getConnection(); storeWithConnection(c, o); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void abortTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); abortTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void delete(QueryClass qc, Constraint c) throws ObjectStoreException { Connection con = null; try { con = getConnection(); deleteWithConnection(con, qc, c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(con); } }
/** * {@inheritDoc} */ @Override public void batchCommitTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); batchCommitTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void store(Object o) throws ObjectStoreException { Connection c = null; try { c = getConnection(); storeWithConnection(c, o); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void delete(InterMineObject o) throws ObjectStoreException { Connection c = null; try { c = getConnection(); deleteWithConnection(c, o); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void batchCommitTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); batchCommitTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void delete(InterMineObject o) throws ObjectStoreException { Connection c = null; try { c = getConnection(); deleteWithConnection(c, o); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void delete(QueryClass qc, Constraint c) throws ObjectStoreException { Connection con = null; try { con = getConnection(); deleteWithConnection(con, qc, c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(con); } }
/** * {@inheritDoc} */ @Override public void addToCollection(Integer hasId, Class<?> clazz, String fieldName, Integer hadId) throws ObjectStoreException { Connection c = null; try { c = getConnection(); addToCollectionWithConnection(c, hasId, clazz, fieldName, hadId); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public boolean isInTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); return isInTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void commitTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); commitTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public boolean isInTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); return isInTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void beginTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); beginTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void commitTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); commitTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void addToCollection(Integer hasId, Class<?> clazz, String fieldName, Integer hadId) throws ObjectStoreException { Connection c = null; try { c = getConnection(); addToCollectionWithConnection(c, hasId, clazz, fieldName, hadId); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void beginTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); beginTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void abortTransaction() throws ObjectStoreException { Connection c = null; try { c = getConnection(); abortTransactionWithConnection(c); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} */ @Override public void replaceClob(Clob clob, String text) throws ObjectStoreException { try { Connection c = null; try { c = getConnection(); replaceClobWithConnection(c, clob, text); } finally { releaseConnection(c); } } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } }
protected void setUp() throws Exception { super.setUp(); uosw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.userprofile-test"); if (uosw instanceof ObjectStoreWriterInterMineImpl) { con = ((ObjectStoreWriterInterMineImpl) uosw).getConnection(); } trackQueue = new ArrayBlockingQueue<Track>(count); //create the table if doesn't exist LoginTracker.getInstance(con, trackQueue); }