Interface Lock

All Superinterfaces:
AutoCloseable

public interface Lock extends AutoCloseable
An acquired lock on an entity for a transaction, acquired from Transaction.acquireWriteLock(Entity) or Transaction.acquireReadLock(Entity) this lock can be released manually using release(). If not released manually it will be automatically released when the transaction owning it finishes.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Release this lock as described by release() method.
    void
    Releases this lock before the transaction finishes.
  • Method Details

    • release

      void release()
      Releases this lock before the transaction finishes. It is an optional operation and if not called, this lock will be released when the owning transaction finishes.
      Throws:
      IllegalStateException - if this lock has already been released.
    • close

      default void close()
      Release this lock as described by release() method.
      Throws:
      IllegalStateException - if this lock has already been released.