code: public static boolean isSqlStateRollbackException(SQLException se) {
          String sqlState = se.getSQLState();
          return sqlState != null && sqlState.startsWith("40");
      }
docs: Determines if the SQL exception is a rollback exception
  
  @param se the exception
  @return true if it is a code 40nnn, otherwise false