Package com.mckoi.database
Class LockHandle
java.lang.Object
com.mckoi.database.LockHandle
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
Modifier and TypeMethodDescriptionvoid
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.toString()
-
Method Details
-
checkAccess
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. -
toString
-