use of cbit.vcell.server.UpdateSynchronizationException in project vcell by virtualcell.
the class AdminDBTopLevel method deleteServiceStatus.
public void deleteServiceStatus(ServiceStatus serviceStatus, boolean bEnableRetry) throws SQLException, UpdateSynchronizationException {
Object lock = new Object();
Connection con = conFactory.getConnection(lock);
try {
ServiceStatus currentServiceStatus = serviceStatusDB.getServiceStatus(con, serviceStatus.getServiceSpec().getServerID(), serviceStatus.getServiceSpec().getType(), serviceStatus.getServiceSpec().getOrdinal(), false);
if (currentServiceStatus == null) {
throw new UpdateSynchronizationException("service doesn't exist:" + currentServiceStatus);
}
serviceStatusDB.deleteServiceStatus(con, serviceStatus, conFactory.getKeyFactory().getNewKey(con));
con.commit();
} catch (Throwable e) {
lg.error("failure in deleteServiceStatus()", e);
try {
con.rollback();
} catch (Throwable rbe) {
lg.error("exception during rollback, bEnableRetry = " + bEnableRetry, rbe);
}
if (bEnableRetry && isBadConnection(con)) {
conFactory.failed(con, lock);
deleteServiceStatus(serviceStatus, false);
} else {
handle_SQLException(e);
}
} finally {
conFactory.release(con, lock);
}
}
Aggregations