Package org.hibernate.exception

Examples of org.hibernate.exception.LockTimeoutException


      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );

        if ( "41000".equals( sqlState ) ) {
          return new LockTimeoutException( message, sqlException, sql );
        }

        if ( "40001".equals( sqlState ) ) {
          return new LockAcquisitionException( message, sqlException, sql );
        }
View Full Code Here


      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
        if("JZ0TO".equals( sqlState ) || "JZ006".equals( sqlState )){
          throw new LockTimeoutException( message, sqlException, sql );
        }
        if ( 515 == errorCode && "ZZZZZ".equals( sqlState ) ) {
          // Attempt to insert NULL value into column; column does not allow nulls.
          final String constraintName = getViolatedConstraintNameExtracter().extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
View Full Code Here

      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );

        if( -952 == errorCode && "57014".equals( sqlState )){
          throw new LockTimeoutException( message, sqlException, sql );
        }
        return null;
      }
    };
  }
View Full Code Here

        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );

        if ( errorCode == 131 ) {
          // 131 - Transaction rolled back by lock wait timeout
          return new LockTimeoutException( message, sqlException, sql );
        }

        if ( errorCode == 146 ) {
          // 146 - Resource busy and acquire with NOWAIT specified
          return new LockTimeoutException( message, sqlException, sql );
        }

        if ( errorCode == 132 ) {
          // 132 - Transaction rolled back due to unavailable resource
          return new LockAcquisitionException( message, sqlException, sql );
View Full Code Here

        // lock timeouts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        if ( errorCode == 30006 ) {
          // ORA-30006: resource busy; acquire with WAIT timeout expired
          throw new LockTimeoutException( message, sqlException, sql );
        }
        else if ( errorCode == 54 ) {
          // ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
          throw new LockTimeoutException( message, sqlException, sql );
        }
        else if ( 4021 == errorCode ) {
          // ORA-04021 timeout occurred while waiting to lock object
          throw new LockTimeoutException( message, sqlException, sql );
        }


        // deadlocks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View Full Code Here

        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
        if ( "HY008".equals( sqlState ) ) {
          throw new QueryTimeoutException( message, sqlException, sql );
        }
        if (1222 == errorCode ) {
          throw new LockTimeoutException( message, sqlException, sql );
        }
        return null;
      }
    };
  }
View Full Code Here

    return new SQLExceptionConversionDelegate() {
      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        if("JZ0TO".equals( sqlState ) || "JZ006".equals( sqlState )){
          throw new LockTimeoutException( message, sqlException, sql );
        }
        return null;
      }
    };
  }
View Full Code Here

      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );

        if( -952 == errorCode && "57014".equals( sqlState )){
          throw new LockTimeoutException( message, sqlException, sql );
        }
        return null;
      }
    };
  }
View Full Code Here

      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );

        if ( "41000".equals( sqlState ) ) {
          return new LockTimeoutException( message, sqlException, sql );
        }

        if ( "40001".equals( sqlState ) ) {
          return new LockAcquisitionException( message, sqlException, sql );
        }
View Full Code Here

      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
        if("JZ0TO".equals( sqlState ) || "JZ006".equals( sqlState )){
          throw new LockTimeoutException( message, sqlException, sql );
        }
        if ( 515 == errorCode && "ZZZZZ".equals( sqlState ) ) {
          // Attempt to insert NULL value into column; column does not allow nulls.
          final String constraintName = getViolatedConstraintNameExtracter().extractConstraintName( sqlException );
          return new ConstraintViolationException( message, sqlException, sql, constraintName );
View Full Code Here

TOP

Related Classes of org.hibernate.exception.LockTimeoutException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.