org.apache.derby.iapi.services.locks
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
 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

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.