Class LockHandle


  • public final class LockHandle
    extends java.lang.Object
    This represents a handle for a series of locks that a query has over the tables in a database. It is returned by the 'LockingMechanism' object after the 'lockTables' method is used.

    Author:
    Tobias Downer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkAccess​(DataTable table, int access_type)
      Blocks until access to the given DataTable object is safe.
      void finalize()
      On garbage collection, this will call 'unlockAll' just in case the program did not use the 'LockingMechanism.unlockTables' method in error.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • checkAccess

        public void checkAccess​(DataTable table,
                                int access_type)
        Blocks until access to the given DataTable object is safe. It blocks using either the read or read/write privs that it has been given. Note that this method is public and is a method that is intended to be used outside the locking mechanism. We also provide an 'access_type' field which is set to the type of access that is happening for this check. This is either Lock.READ or Lock.WRITE. NOTE: Any call to this method after the first call should be instantanious.
      • finalize

        public void finalize()
        On garbage collection, this will call 'unlockAll' just in case the program did not use the 'LockingMechanism.unlockTables' method in error. This should ensure the database does not deadlock. This method is a 'just in case' clause.
        Overrides:
        finalize in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object