@Override public void commitDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Committing database batch write with connection: " + conn.get().toString()); try { conn.get().commit(); conn.get().setAutoCommit(true); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void commitDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Committing database batch write with connection: " + conn.get().toString()); try { conn.get().commit(); conn.get().setAutoCommit(true); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void commitDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Committing database batch write with connection: " + conn.get().toString()); try { conn.get().commit(); conn.get().setAutoCommit(true); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void commitDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Committing database batch write with connection: " + conn.get().toString()); try { conn.get().commit(); conn.get().setAutoCommit(true); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void beginDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Starting database batch write with connection: " + conn.get().toString()); try { conn.get().setAutoCommit(false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void beginDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Starting database batch write with connection: " + conn.get().toString()); try { conn.get().setAutoCommit(false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void beginDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Starting database batch write with connection: " + conn.get().toString()); try { conn.get().setAutoCommit(false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void beginDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Starting database batch write with connection: " + conn.get().toString()); try { conn.get().setAutoCommit(false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void abortDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Rollback database batch write with connection: " + conn.get().toString()); try { if (!conn.get().getAutoCommit()) { conn.get().rollback(); conn.get().setAutoCommit(true); } else { log.warn("Warning: Rollback attempt without transaction"); } } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void abortDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Rollback database batch write with connection: " + conn.get().toString()); try { if (!conn.get().getAutoCommit()) { conn.get().rollback(); conn.get().setAutoCommit(true); } else { log.warn("Warning: Rollback attempt without transaction"); } } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void abortDatabaseBatchWrite() throws BlockStoreException { maybeConnect(); if (log.isDebugEnabled()) log.debug("Rollback database batch write with connection: " + conn.get().toString()); try { if (!conn.get().getAutoCommit()) { conn.get().rollback(); conn.get().setAutoCommit(true); } else { log.warn("Warning: Rollback attempt without transaction"); } } catch (SQLException e) { throw new BlockStoreException(e); } }
/** * Deletes the store by deleting the tables within the database. * @throws BlockStoreException If tables couldn't be deleted. */ public void deleteStore() throws BlockStoreException { maybeConnect(); try { Statement s = conn.get().createStatement(); for(String sql : getDropTablesSQL()) { s.execute(sql); } s.close(); } catch (SQLException ex) { throw new RuntimeException(ex); } }
@Override public void put(StoredBlock storedBlock) throws BlockStoreException { maybeConnect(); try { putUpdateStoredBlock(storedBlock, false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void put(StoredBlock storedBlock) throws BlockStoreException { maybeConnect(); try { putUpdateStoredBlock(storedBlock, false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void put(StoredBlock storedBlock) throws BlockStoreException { maybeConnect(); try { putUpdateStoredBlock(storedBlock, false); } catch (SQLException e) { throw new BlockStoreException(e); } }
@Override public void put(StoredBlock storedBlock) throws BlockStoreException { maybeConnect(); try { putUpdateStoredBlock(storedBlock, false); } catch (SQLException e) { throw new BlockStoreException(e); } }
/** * Resets the store by deleting the contents of the tables and reinitialising them. * @throws BlockStoreException If the tables couldn't be cleared and initialised. */ public void resetStore() throws BlockStoreException { maybeConnect(); try { deleteStore(); createTables(); initFromDatabase(); } catch (SQLException ex) { throw new RuntimeException(ex); } }
/** * Resets the store by deleting the contents of the tables and reinitialising them. * @throws BlockStoreException If the tables couldn't be cleared and initialised. */ public void resetStore() throws BlockStoreException { maybeConnect(); try { deleteStore(); createTables(); initFromDatabase(); } catch (SQLException ex) { throw new RuntimeException(ex); } }
/** * Resets the store by deleting the contents of the tables and reinitialising them. * @throws BlockStoreException If the tables couldn't be cleared and initialised. */ public void resetStore() throws BlockStoreException { maybeConnect(); try { deleteStore(); createTables(); initFromDatabase(); } catch (SQLException ex) { throw new RuntimeException(ex); } }
/** * Resets the store by deleting the contents of the tables and reinitialising them. * @throws BlockStoreException If the tables couldn't be cleared and initialised. */ public void resetStore() throws BlockStoreException { maybeConnect(); try { deleteStore(); createTables(); initFromDatabase(); } catch (SQLException ex) { throw new RuntimeException(ex); } }