InternalXact
, UpdateLoader
, Xact
public interface LockOwner
Modifier and Type | Method | Description |
---|---|---|
boolean |
isNestedOwner() |
Return true if this is a nested owner, e.g., a nested user transaction.
|
boolean |
nestsUnder(LockOwner other) |
Return true if this owner nests under another owner.
|
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. |
boolean noWait()
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.
true
if timed waits should time out immediately,
false
otherwiseboolean isNestedOwner()
Return true if this is a nested owner, e.g., a nested user transaction.
boolean nestsUnder(LockOwner other)
Return true if this owner nests under another owner.
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.