| java.lang.Object org.continuent.sequoia.common.locks.WaitForGraph
WaitForGraph | public class WaitForGraph (Code) | | This class defines a WaitForGraph. Nodes in the graph represent active
transactions. Edges represent "waitin for" relationships: the source node is
waiting for the sink node to release a lock on a given resource. This class
allows to detect cycles in the graph, i.e. deadlocks, and to determine which
transaction to abort in order to break one or more cycles.
author: Damian Arregui version: 1.0 |
Method Summary | |
public boolean | detectDeadlocks() Detects deadlocks in the wait-for graph. | public long | getVictimTransactionId() Returns the ID of the transaction that should be aborted first. |
WaitForGraph | public WaitForGraph(DatabaseBackend backend, List storedProcedureQueue)(Code) | | Creates a new WaitForGraph object.
Parameters: backend - database backend that will be used to build the graph. Parameters: storedProcedureQueue - also used to build the graph. |
detectDeadlocks | public boolean detectDeadlocks()(Code) | | Detects deadlocks in the wait-for graph. First build the graph from the
database schema, then walk the graph to detect cycles, and finally examines
the cycles (if found) in order to determine a suitable transaction to be
aborted.
true is a deadlock has been detected, false otherwise. |
getVictimTransactionId | public long getVictimTransactionId()(Code) | | Returns the ID of the transaction that should be aborted first. This method
returns a value computed during the last run of
WaitForGraph.detectDeadlocks() .
victiom transaction ID. |
|
|