Interface LockOwner

  • All Known Implementing Classes:
    InternalXact, UpdateLoader, Xact

    public interface LockOwner
    Interface for classes that represent an owner of the locks within a compatibility space.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isNestedOwner()
      Return true if this is a nested owner, e.g., a nested user transaction.
      boolean nestsUnder​(LockOwner other)
      Return true if this owner nests under another owner.
      boolean noWait()
      Tells whether lock requests should time out immediately if the lock cannot be granted at once, even if C_LockFactory.TIMED_WAIT was specified in the lock request.
    • Method Detail

      • noWait

        boolean noWait()
        Tells whether lock requests should time out immediately if the lock cannot be granted at once, even if C_LockFactory.TIMED_WAIT was specified in the lock request.

        Normally, this method should return false, but in some very special cases it could be appropriate to return true. One example is when a stored prepared statement (SPS) is compiled and stored in a system table. In order to prevent exclusive locks in the system table from being held until the transaction that triggered the compilation is finished, the SPS will be compiled in a nested transaction that is committed and releases all locks upon completion. There is however a risk that the transaction that triggered the compilation is holding locks that the nested transaction needs, in which case the nested transaction will time out. The timeout will be detected by the calling code, and the operation will be retried in the parent transaction. To avoid long waits in the cases where the nested transaction runs into a lock conflict with its parent, the nested transaction's LockOwner instance could return true and thereby making it possible to detect lock conflicts instantly.

        Returns:
        true if timed waits should time out immediately, false otherwise
      • isNestedOwner

        boolean isNestedOwner()

        Return true if this is a nested owner, e.g., a nested user transaction.

      • nestsUnder

        boolean nestsUnder​(LockOwner other)

        Return true if this owner nests under another owner.