protected ServiceAccessException createException(SQLException e, String uri) {
switch (e.getErrorCode()) {
case 1205 : // thread was deadlock victim
getLogger().log(e.getErrorCode() + ": Deadlock resolved on " + uri, LOG_CHANNEL, Logger.WARNING);
return new ServiceAccessException(service, new ConflictException(uri));
case 547 : // referential integraty constaint was violated (like in storeObject on table URI )
case 2627 : // primary key constraint violation (like in storeContent on table VERSION_CONTENT)
getLogger().log(e.getErrorCode() + ": Low isolation conflict for " + uri, LOG_CHANNEL, Logger.WARNING);
return new ServiceAccessException(service, new ConflictException(uri));
default :
getLogger().log("SQL error " + e.getErrorCode() + " on " + uri + ": " + e.getMessage(),
LOG_CHANNEL,
Logger.ERROR);