Class TransactionTable

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.ResultSet, java.sql.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.
    • Field Detail

      • initialized

        boolean initialized
      • currentRow

        int currentRow
      • wasNull

        private boolean wasNull
      • metadata

        private static final java.sql.ResultSetMetaData metadata
    • Method Detail

      • getMetaData

        public java.sql.ResultSetMetaData getMetaData()
        Specified by:
        getMetaData in interface java.sql.ResultSet
        Overrides:
        getMetaData in class VTITemplate
        See Also:
        ResultSet.getMetaData()
      • next

        public boolean next()
                     throws java.sql.SQLException
        Specified by:
        next in interface java.sql.ResultSet
        Throws:
        java.sql.SQLException - if no transaction context can be found
        See Also:
        ResultSet.next()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.sql.ResultSet
        See Also:
        ResultSet.close()
      • getString

        public java.lang.String getString​(int columnNumber)
        All columns in TransactionTable VTI is of String type.
        Specified by:
        getString in interface java.sql.ResultSet
        Overrides:
        getString in class VTITemplate
        See Also:
        ResultSet.getString(int)
      • wasNull

        public boolean wasNull()
        Specified by:
        wasNull in interface java.sql.ResultSet
        Overrides:
        wasNull in class VTITemplate
        See Also:
        ResultSet.wasNull()