Package org.hibernate

Interface Session.LockRequest

Enclosing interface:
Session

@Deprecated(since="6.2") public static interface Session.LockRequest
Deprecated.
simply construct a LockOptions and pass it to Session.lock(Object, LockOptions).
A set of locking options attached to the session.
  • Field Details

    • PESSIMISTIC_NO_WAIT

      static final int PESSIMISTIC_NO_WAIT
      Deprecated.
      A timeout value indicating that the database should not wait at all to acquire a pessimistic lock which is not immediately available. This has the same effect as LockMode.UPGRADE_NOWAIT.
      See Also:
    • PESSIMISTIC_WAIT_FOREVER

      static final int PESSIMISTIC_WAIT_FOREVER
      Deprecated.
      A timeout value indicating that attempting to acquire that there is no timeout for the lock acquisition.
      See Also:
  • Method Details

    • getLockMode

      LockMode getLockMode()
      Deprecated.
      Get the lock mode.
      Returns:
      the lock mode.
    • setLockMode

      Session.LockRequest setLockMode(LockMode lockMode)
      Deprecated.
      Specify the LockMode to be used. The default is LockMode.NONE.
      Parameters:
      lockMode - the lock mode to use for this request
      Returns:
      this LockRequest instance for operation chaining.
    • getTimeOut

      int getTimeOut()
      Deprecated.
      Get the timeout setting.
      Returns:
      timeout in milliseconds, -1 for indefinite wait and 0 for no wait.
    • setTimeOut

      Session.LockRequest setTimeOut(int timeout)
      Deprecated.
      Specify the pessimistic lock timeout. The default pessimistic lock behavior is to wait forever for the lock. Lock timeout support is not available in every dialect of SQL.
      Parameters:
      timeout - is time in milliseconds to wait for lock. -1 means wait forever and 0 means no wait.
      Returns:
      this LockRequest instance for operation chaining.
    • getScope

      @Deprecated(since="6.2") boolean getScope()
      Deprecated.
      Check if locking extends to owned collections and associated entities.
      Returns:
      true if locking will be extended to owned collections and associated entities
    • getLockScope

      default PessimisticLockScope getLockScope()
      Deprecated.
      Obtain the PessimisticLockScope, which determines if locking extends to owned collections and associated entities.
    • setScope

      @Deprecated(since="6.2") Session.LockRequest setScope(boolean scope)
      Specify whether the LockMode should extend to owned collections and associated entities. An association must be mapped with CascadeType.LOCK for this setting to have any effect.
      Parameters:
      scope - true to cascade locks; false to not.
      Returns:
      this, for method chaining
    • setLockScope

      default Session.LockRequest setLockScope(PessimisticLockScope scope)
      Deprecated.
      Set the PessimisticLockScope, which determines if locking extends to owned collections and associated entities.
    • lock

      @Deprecated(since="6.2") void lock(String entityName, Object object)
      Deprecated.
      Perform the requested locking.
      Parameters:
      entityName - the name of the entity to lock
      object - the instance of the entity to lock
    • lock

      void lock(Object object)
      Deprecated.
      Perform the requested locking.
      Parameters:
      object - the instance of the entity to lock