|| SQLNonTransientConnectionException.class.isInstance( sqlException ) || SQLTransientConnectionException.class.isInstance( sqlException ) ) { return new JDBCConnectionException( message, sqlException, sql );
return new JDBCConnectionException( message, sqlException, sql );
@Override public JDBCException convert(SQLException sqlException, String message, String sql) { final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException ) & 0xFF; if (errorCode == SQLITE_TOOBIG || errorCode == SQLITE_MISMATCH) { return new DataException( message, sqlException, sql ); } else if (errorCode == SQLITE_BUSY || errorCode == SQLITE_LOCKED) { return new LockAcquisitionException( message, sqlException, sql ); } else if ((errorCode >= SQLITE_IOERR && errorCode <= SQLITE_PROTOCOL) || errorCode == SQLITE_NOTADB) { return new JDBCConnectionException( message, sqlException, sql ); } // returning null allows other delegates to operate return null; } };
|| SQLNonTransientConnectionException.class.isInstance( sqlException ) || SQLTransientConnectionException.class.isInstance( sqlException ) ) { return new JDBCConnectionException( message, sqlException, sql );
|| SQLNonTransientConnectionException.class.isInstance( sqlException ) || SQLTransientConnectionException.class.isInstance( sqlException ) ) { return new JDBCConnectionException( message, sqlException, sql );
/** * Convert the given SQLException into Hibernate's JDBCException hierarchy. * * @param sqlException The SQLException to be converted. * @param message An optional error message. * @param sql Optionally, the sql being performed when the exception occurred. * @return The resulting JDBCException. */ public JDBCException convert(SQLException sqlException, String message, String sql) { String sqlStateClassCode = JDBCExceptionHelper.extractSqlStateClassCode( sqlException ); if ( sqlStateClassCode != null ) { if ( SQL_GRAMMAR_CATEGORIES.contains( sqlStateClassCode ) ) { return new SQLGrammarException( message, sqlException, sql ); } else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( sqlStateClassCode ) ) { String constraintName = extracter.extractConstraintName( sqlException ); return new ConstraintViolationException( message, sqlException, sql, constraintName ); } else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) { return new JDBCConnectionException( message, sqlException, sql ); } } return handledNonSpecificException( sqlException, message, sql ); }
|| SQLNonTransientConnectionException.class.isInstance( sqlException ) || SQLTransientConnectionException.class.isInstance( sqlException ) ) { return new JDBCConnectionException( message, sqlException, sql );
@Override public JDBCException convert(SQLException sqlException, String message, String sql) { final int errorCode = sqlException.getErrorCode(); if (errorCode == SQLITE_CONSTRAINT) { final String constraintName = EXTRACTER.extractConstraintName(sqlException); return new ConstraintViolationException(message, sqlException, sql, constraintName); } else if (errorCode == SQLITE_TOOBIG || errorCode == SQLITE_MISMATCH) { return new DataException(message, sqlException, sql); } else if (errorCode == SQLITE_BUSY || errorCode == SQLITE_LOCKED) { return new LockAcquisitionException(message, sqlException, sql); } else if ((errorCode >= SQLITE_IOERR && errorCode <= SQLITE_PROTOCOL) || errorCode == SQLITE_NOTADB) { return new JDBCConnectionException(message, sqlException, sql); } return new GenericJDBCException(message, sqlException, sql); } };
return new JDBCConnectionException( message, sqlException, sql );
return new JDBCConnectionException( message, sqlException, sql );
return new JDBCConnectionException( message, sqlException, sql );
return new JDBCConnectionException( message, sqlException, sql );
/** * Convert the given SQLException into Hibernate's JDBCException hierarchy. * * @param sqlException The SQLException to be converted. * @param message An optional error message. * @param sql Optionally, the sql being performed when the exception occurred. * @return The resulting JDBCException. */ public JDBCException convert(SQLException sqlException, String message, String sql) { int errorCode = JDBCExceptionHelper.extractErrorCode( sqlException ); if ( isMatch( getConnectionErrorCodes(), errorCode ) ) { return new JDBCConnectionException( message, sqlException, sql ); } else if ( isMatch( getSQLGrammarErrorCodes(), errorCode ) ) { return new SQLGrammarException( message, sqlException, sql ); } else if ( isMatch( getIntegrityViolationErrorCodes(), errorCode ) ) { String constraintName = extracter.extractConstraintName( sqlException ); return new ConstraintViolationException( message, sqlException, sql, constraintName ); } else if ( isMatch( getLockAcquisitionErrorCodes(), errorCode ) ) { return new LockAcquisitionException( message, sqlException, sql ); } return handledNonSpecificException( sqlException, message, sql ); }
return adaptInstantiationException((net.sf.hibernate.InstantiationException) ex); if (ex instanceof net.sf.hibernate.exception.JDBCConnectionException) return new org.hibernate.exception.JDBCConnectionException(ex.getMessage(), getSQLExceptionFromThrowable(ex.getCause())); if (ex instanceof net.sf.hibernate.exception.LockAcquisitionException) return new org.hibernate.exception.LockAcquisitionException(ex.getMessage(), getSQLExceptionFromThrowable(ex.getCause()));