@Override public JDBCException convert(SQLException sqlException, String message, String sql) { final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException ); if (40001 == errorCode) { // DEADLOCK DETECTED return new LockAcquisitionException(message, sqlException, sql); } if (50200 == errorCode) { // LOCK NOT AVAILABLE return new PessimisticLockException(message, sqlException, sql); } if ( 90006 == errorCode ) { // NULL not allowed for column [90006-145] final String constraintName = getViolatedConstraintNameExtracter().extractConstraintName( sqlException ); return new ConstraintViolationException( message, sqlException, sql, constraintName ); } return null; } };
@Override public JDBCException convert(SQLException sqlException, String message, String sql) { final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException ); if (40001 == errorCode) { // DEADLOCK DETECTED return new LockAcquisitionException(message, sqlException, sql); } if (50200 == errorCode) { // LOCK NOT AVAILABLE return new PessimisticLockException(message, sqlException, sql); } if ( 90006 == errorCode ) { // NULL not allowed for column [90006-145] final String constraintName = getViolatedConstraintNameExtracter().extractConstraintName( sqlException ); return new ConstraintViolationException( message, sqlException, sql, constraintName ); } return null; } };