|
|||||||||
| Home >> All >> org >> apache >> derby >> [ diag overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.diag
Class LockTable

java.lang.Objectorg.apache.derby.vti.VTITemplate
org.apache.derby.diag.LockTable
- All Implemented Interfaces:
- java.sql.ResultSet, org.apache.derby.vti.VTICosting
- public class LockTable
- extends org.apache.derby.vti.VTITemplate
- implements org.apache.derby.vti.VTICosting
- extends org.apache.derby.vti.VTITemplate
LockTable is a virtual table that shows all locks currently held in the database. This virtual table can be invoked by calling it directly
select * from new org.apache.derby.diag.LockTable() t;or through the system alias LOCKTABLE
select * from new LOCKTABLE() t;
The LockTable virtual table takes a snap shot of the lock table while the system is in flux, so it is possible that some locks may be in transition state while the snap shot is taken. We choose to do this rather then impose extranous timing restrictions so that the use of this tool will not alter the normal timing and flow of execution in the application.
The LockTable virtual table has the following columns:
- XID varchar(15) - not nullable. The transaction id, this can be joined with the TransactionTable virtual table's XID.
- TYPE varchar(5) - nullable. The type of lock, ROW, TABLE, or LATCH
- MODE varchar(4) - not nullable. The mode of the lock, "S", "U", "X", "IS", "IX".
- S is shared lock (N/A to Latch)
- U is update lock (N/A to Latch)
- X is exclusive lock
- IS is intent shared lock (N/A to Latch or Row lock)
- IX is intent exclusive lock (N/A to Latch or Row lock)
- TABLENAME varchar(128) - not nullable. The name of the base table the lock is for
- LOCKNAME varchar(20) - not nullable. The name of the lock
- STATE varchar(5) - nullable. GRANT or WAIT
- TABLETYPE varchar(9) - not nullable. 'T' for user table, 'S' for system table
- LOCKCOUNT varchar(5) - not nullable. Internal lock count.
- INDEXNAME varchar(128) - normally null. If non-null, a lock is held on the index, this can only happen if this is not a user transaction.
| Field Summary | |
static int |
ALL
return all locks and latches |
private static org.apache.derby.iapi.sql.ResultColumnDescriptor[] |
columnInfo
|
private java.util.Hashtable |
currentRow
|
private int |
flag
|
private boolean |
initialized
|
static int |
LATCH
return only latches |
private org.apache.derby.iapi.sql.conn.LanguageConnectionFactory |
lcf
|
private java.util.Enumeration |
lockTable
|
private static java.sql.ResultSetMetaData |
metadata
|
private org.apache.derby.impl.services.locks.TableNameInfo |
tabInfo
|
static int |
TABLE_AND_ROWLOCK
return only table and row locks |
private org.apache.derby.iapi.store.access.TransactionController |
tc
|
private boolean |
wasNull
|
| Fields inherited from interface org.apache.derby.vti.VTICosting |
defaultEstimatedCost, defaultEstimatedRowCount |
| Fields inherited from interface java.sql.ResultSet |
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
| Constructor Summary | |
LockTable()
The normal way of instantiating a LockTable, equivalent to LockTable(org.apache.derby.diag.LockTable->TABLE_AND_ROWLOCK). |
|
LockTable(int flag)
This call is intrusive and should only be used under the supervision of technical support. |
|
| Method Summary | |
void |
close()
This method closes the result set and frees any associated resources. |
private java.util.Hashtable |
dumpLock(org.apache.derby.iapi.services.locks.Latch lock)
Convert the lock information into a hashtable. |
double |
getEstimatedCostPerInstantiation(org.apache.derby.vti.VTIEnvironment vtiEnvironment)
Get the estimated cost for a single instantiation of a VTI. |
double |
getEstimatedRowCount(org.apache.derby.vti.VTIEnvironment vtiEnvironment)
Get the estimated row count for a single scan of a VTI. |
java.sql.ResultSetMetaData |
getMetaData()
This method returns data about the columns returned as part of the result set as a ResultSetMetaData instance. |
java.lang.String |
getString(int columnNumber)
All columns in TransactionTable VTI are of String type. |
boolean |
next()
This method advances to the next row in the result set. |
boolean |
supportsMultipleInstantiations(org.apache.derby.vti.VTIEnvironment vtiEnvironment)
Find out if the ResultSet of the VTI can be instantiated multiple times. |
boolean |
wasNull()
This method tests whether the value of the last column that was fetched was actually a SQL NULL value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
LATCH
public static final int LATCH
- return only latches
- See Also:
- Constant Field Values
TABLE_AND_ROWLOCK
public static final int TABLE_AND_ROWLOCK
- return only table and row locks
- See Also:
- Constant Field Values
ALL
public static final int ALL
- return all locks and latches
- See Also:
- Constant Field Values
tc
private org.apache.derby.iapi.store.access.TransactionController tc
lcf
private org.apache.derby.iapi.sql.conn.LanguageConnectionFactory lcf
currentRow
private java.util.Hashtable currentRow
lockTable
private java.util.Enumeration lockTable
wasNull
private boolean wasNull
initialized
private boolean initialized
flag
private final int flag
tabInfo
private org.apache.derby.impl.services.locks.TableNameInfo tabInfo
columnInfo
private static final org.apache.derby.iapi.sql.ResultColumnDescriptor[] columnInfo
metadata
private static final java.sql.ResultSetMetaData metadata
| Constructor Detail |
LockTable
public LockTable()
- The normal way of instantiating a LockTable, equivalent to
LockTable(org.apache.derby.diag.LockTable->TABLE_AND_ROWLOCK).
Only shows row and table lock and not latches. Latches are generally
held for very short duration and are not of interest to Cloudscape
users. Only under abnormal circumstances will one be interested in
looking at latches.
LockTable
public LockTable(int flag)
- This call is intrusive and should only be used under the supervision of
technical support. Create an instance of the lock table which
has transient latches as well as locks.
| Method Detail |
getMetaData
public java.sql.ResultSetMetaData getMetaData()
- Description copied from interface:
java.sql.ResultSet - This method returns data about the columns returned as part of the
result set as a
ResultSetMetaDatainstance.- Specified by:
getMetaDatain interfacejava.sql.ResultSet
next
public boolean next()
throws java.sql.SQLException
- Description copied from interface:
java.sql.ResultSet - This method advances to the next row in the result set. Any streams
open on the current row are closed automatically.
- Specified by:
nextin interfacejava.sql.ResultSet
close
public void close()
- Description copied from interface:
java.sql.ResultSet - This method closes the result set and frees any associated resources.
- Specified by:
closein interfacejava.sql.ResultSet
getString
public java.lang.String getString(int columnNumber)
- All columns in TransactionTable VTI are of String type.
- Specified by:
getStringin interfacejava.sql.ResultSet
wasNull
public boolean wasNull()
- Description copied from interface:
java.sql.ResultSet - This method tests whether the value of the last column that was fetched
was actually a SQL NULL value.
- Specified by:
wasNullin interfacejava.sql.ResultSet
getEstimatedRowCount
public double getEstimatedRowCount(org.apache.derby.vti.VTIEnvironment vtiEnvironment)
- Description copied from interface:
org.apache.derby.vti.VTICosting - Get the estimated row count for a single scan of a VTI.
- Specified by:
getEstimatedRowCountin interfaceorg.apache.derby.vti.VTICosting
getEstimatedCostPerInstantiation
public double getEstimatedCostPerInstantiation(org.apache.derby.vti.VTIEnvironment vtiEnvironment)
- Description copied from interface:
org.apache.derby.vti.VTICosting - Get the estimated cost for a single instantiation of a VTI.
- Specified by:
getEstimatedCostPerInstantiationin interfaceorg.apache.derby.vti.VTICosting
supportsMultipleInstantiations
public boolean supportsMultipleInstantiations(org.apache.derby.vti.VTIEnvironment vtiEnvironment)
- Description copied from interface:
org.apache.derby.vti.VTICosting - Find out if the ResultSet of the VTI can be instantiated multiple times.
- Specified by:
supportsMultipleInstantiationsin interfaceorg.apache.derby.vti.VTICosting
dumpLock
private java.util.Hashtable dumpLock(org.apache.derby.iapi.services.locks.Latch lock) throws org.apache.derby.iapi.error.StandardException
- Convert the lock information into a hashtable.
|
|||||||||
| Home >> All >> org >> apache >> derby >> [ diag overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC