private void ensureSingleUpdate(Statement statement) throws ObjectNotInLowlevelStorageException, LowlevelStorageInconsistencyException, LowlevelStorageException { try{ int updateCount = statement.getUpdateCount(); if (updateCount == 0) { throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: -no- rows updated in db registry"); } if (updateCount > 1) { throw new LowlevelStorageInconsistencyException("-multiple- rows updated in db registry"); } } catch (SQLException e1) { throw new LowlevelStorageException(true, "sql failurex (exec)", e1); } }
private void ensureSingleUpdate(Statement statement) throws ObjectNotInLowlevelStorageException, LowlevelStorageInconsistencyException, LowlevelStorageException { try{ int updateCount = statement.getUpdateCount(); if (updateCount == 0) { throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: -no- rows updated in db registry"); } if (updateCount > 1) { throw new LowlevelStorageInconsistencyException("-multiple- rows updated in db registry"); } } catch (SQLException e1) { throw new LowlevelStorageException(true, "sql failurex (exec)", e1); } }
@Override public void remove(String pid) throws ObjectNotInLowlevelStorageException, LowlevelStorageInconsistencyException, LowlevelStorageException { try { executeUpdate(deleteByIdQuery, pid); } catch (ObjectNotInLowlevelStorageException e1) { throw new ObjectNotInLowlevelStorageException("[" + pid + "] not in db registry to delete", e1); } catch (LowlevelStorageInconsistencyException e2) { throw new LowlevelStorageInconsistencyException("[" + pid + "] deleted from db registry -multiple- times", e2); } }
@Override public void remove(String pid) throws ObjectNotInLowlevelStorageException, LowlevelStorageInconsistencyException, LowlevelStorageException { try { executeUpdate(deleteByIdQuery, pid); } catch (ObjectNotInLowlevelStorageException e1) { throw new ObjectNotInLowlevelStorageException("[" + pid + "] not in db registry to delete", e1); } catch (LowlevelStorageInconsistencyException e2) { throw new LowlevelStorageInconsistencyException("[" + pid + "] deleted from db registry -multiple- times", e2); } }
connectionPool.free(connection); connection = null; throw new LowlevelStorageInconsistencyException( "Null token found in " + getRegistryName());
throw new LowlevelStorageInconsistencyException("[" + pid + "] in db registry -multiple- times"); throw new LowlevelStorageInconsistencyException("[" + pid + "] has -null- path in db registry");
connectionPool.free(connection); connection = null; throw new LowlevelStorageInconsistencyException( "Null token found in " + getRegistryName());
throw new LowlevelStorageInconsistencyException("[" + pid + "] in db registry -multiple- times"); throw new LowlevelStorageInconsistencyException("[" + pid + "] has -null- path in db registry");