Examples of PessimisticLockException


Examples of javax.persistence.PessimisticLockException

        writeLock.lockInterruptibly();
      }
      else if ( timeout == 0 ) {
        boolean locked = writeLock.tryLock();
        if ( ! locked ) {
          throw new PessimisticLockException( "lock on key " + key + " was not available" );
        }
      }
      else {
        writeLock.tryLock( timeout, TimeUnit.MILLISECONDS );
      }
    }
    catch ( InterruptedException e ) {
      throw new PessimisticLockException( "timed out waiting for lock on key " + key, e );
    }
    acquiredLocksPerThread.get().add( writeLock );
  }
View Full Code Here

Examples of javax.persistence.PessimisticLockException

      if (lockOptions !=null && lockOptions.getTimeOut() > -1) {
        // assume lock timeout occurred if a timeout or NO WAIT was specified
        pe = new LockTimeoutException(ple.getMessage(), ple, ple.getEntity());
      }
      else {
        pe = new PessimisticLockException(ple.getMessage(), ple, ple.getEntity());
      }
    }
    else {
      pe = new OptimisticLockException( e );
    }
View Full Code Here

Examples of javax.persistence.PessimisticLockException

      if ( lockOptions != null && lockOptions.getTimeOut() > -1 ) {
        // assume lock timeout occurred if a timeout or NO WAIT was specified
        pe = new LockTimeoutException( ple.getMessage(), ple, ple.getEntity() );
      }
      else {
        pe = new PessimisticLockException( ple.getMessage(), ple, ple.getEntity() );
      }
    }
    else {
      pe = new OptimisticLockException( e );
    }
View Full Code Here

Examples of org.hibernate.PessimisticLockException

          return new LockAcquisitionException( message, sqlException, sql );
        }

        if ( "55P03".equals( sqlState ) ) {
          // LOCK NOT AVAILABLE
          return new PessimisticLockException( message, sqlException, sql );
        }

        // returning null allows other delegates to operate
        return null;
      }
View Full Code Here

Examples of org.hibernate.PessimisticLockException

            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 );
View Full Code Here

Examples of org.hibernate.PessimisticLockException

      JDBCException e = session.getFactory().getSQLExceptionHelper().convert(
          sqle,
          "could not lock: " + MessageHelper.infoString( getLockable(), id, session.getFactory() ),
          sql
      );
      throw new PessimisticLockException( "could not obtain pessimistic lock", e, object );
    }
  }
View Full Code Here

Examples of org.hibernate.PessimisticLockException

      JDBCException e = session.getFactory().getSQLExceptionHelper().convert(
          sqle,
          "could not lock: " + MessageHelper.infoString( getLockable(), id, session.getFactory() ),
          sql
      );
      throw new PessimisticLockException( "could not obtain pessimistic lock", e, object );
    }
  }
View Full Code Here

Examples of org.hibernate.PessimisticLockException

      JDBCException e = session.getFactory().getSQLExceptionHelper().convert(
          sqle,
          "could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
          sql
        );
      throw new PessimisticLockException("could not obtain pessimistic lock", e, object);
    }
  }
View Full Code Here

Examples of org.hibernate.PessimisticLockException

      JDBCException e = session.getFactory().getSQLExceptionHelper().convert(
          sqle,
          "could not lock: " + MessageHelper.infoString( lockable, id, session.getFactory() ),
          sql
        );
      throw new PessimisticLockException("could not obtain pessimistic lock", e, object);
    }
  }
View Full Code Here

Examples of org.hibernate.PessimisticLockException

        return new LockAcquisitionException( message, sqlException, sql );
      }

      if ( "40XL1".equals( sqlState ) || "40XL2".equals( sqlState )) {
        // Derby "A lock could not be obtained within the time requested."
        return new PessimisticLockException( message, sqlException, sql );
      }

      // MySQL Query execution was interrupted
      if ( "70100".equals( sqlState ) ||
        // Oracle user requested cancel of current operation
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.