Top Description Methods
org.apache.derby.iapi.services.locks

public Interface LockOwner

Known Direct Implementers
org.apache.derby.impl.services.reflect.UpdateLoader, org.apache.derby.impl.store.raw.xact.Xact

Interface for classes that represent an owner of the locks within a compatibility space.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this is a nested owner, e.g., a nested user transaction
isNestedOwner
()

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

public boolean

Returns:

true if this owner nests under another owner
nestsUnder
(LockOwner
The other lock owner
other
)

Return true if this owner nests under another owner.

public boolean

Returns:

true if timed waits should time out immediately, false otherwise
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

isNestedOwnerback to summary
public boolean isNestedOwner()

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

Returns:boolean

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

nestsUnderback to summary
public boolean nestsUnder(LockOwner other)

Return true if this owner nests under another owner.

Parameters
other:LockOwner

The other lock owner

Returns:boolean

true if this owner nests under another owner

noWaitback to summary
public 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:boolean

true if timed waits should time out immediately, false otherwise