Class TransactionTable

java.lang.Object
org.apache.derby.vti.VTITemplate
org.apache.derby.diag.TransactionTable
All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, AwareVTI, VTICosting

public class TransactionTable extends VTITemplate implements VTICosting
TransactionTable is a virtual table that shows all transactions currently in the database. This virtual table can be invoked by calling it directly
 select * from SYSCS_DIAG.TRANSACTION_TABLE 

The TransactionTable virtual table takes a snap shot of the transaction table while the system is in flux, so it is possible that some transactions may be in transition state while the snap shot is taken. We choose to do this rather then impose extraneous timing restrictions so that the use of this tool will not alter the normal timing and flow of execution in the application.

The TransactionTable virtual table has the following columns:

  • XID varchar(15) - not nullable. The transaction id, this can be joined with the LockTable virtual table's XID.
  • GLOBAL_XID varchar(140) - nullable. The global transaction id, only set if this transaction is a participant in a distributed transaction.
  • USERNAME varchar(128) - nullable. The user name, or APP by default. May appear null if the transaction is started by Derby.
  • TYPE varchar(30) - not nullable. UserTransaction or an internal transaction spawned by Derby.
  • STATUS varchar(8) - not nullable. IDLE or ACTIVE. A transaction is IDLE only when it is first created or right after it commits. Any transaction that holds or has held any resource in the database is ACTIVE. Accessing the TransactionTable virtual table without using the class alias will not activate the transaction.
  • FIRST_INSTANT varchar(20) - nullable. If null, this is a read only transaction. If not null, this is the first log record instant written by the transaction.
  • SQL_TEXT VARCHAR(32672) - nullable. if null, this transaction is currently not being executed in the database. If not null, this is the SQL statement currently being executed in the database.