Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*-
   * See the file LICENSE for redistribution information.
   *
   * Copyright (c) 2000, 2010 Oracle and/or its affiliates.  All rights reserved.
   *
   */
  
  package com.sleepycat.je;
  
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_ABORTS;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_ACTIVE;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_ACTIVE_TXNS;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_BEGINS;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_COMMITS;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_XAABORTS;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_XACOMMITS;
 import static com.sleepycat.je.dbi.TxnStatDefinition.TXN_XAPREPARES;
 
 
Transaction statistics for a database environment.
 
 public class TransactionStats implements Serializable {
 
     private static final long serialVersionUID = 2136955031L;
 
     private StatGroup stats;

    

Hidden:
Internal use only.
 
     public TransactionStats(StatGroup stats) {
         this. = stats;
     }

    
The Active class represents an active transaction.
 
     public static class Active implements Serializable {
 
         private static final long serialVersionUID = 1286693589L;

        
The transaction ID of the transaction.
 
         private long txnId;

        
The transaction ID of the parent transaction (or 0, if no parent).
 
         private long parentId;

        
The transaction name, including the thread name if available.
 
         private String name;

        
The transaction ID of the transaction.
 
         public long getId() {
             return ;
         }

        
The transaction ID of the parent transaction (or 0, if no parent).
 
         public long getParentId() {
             return ;
         }

        
The transaction name, including the thread name if available.
 
         public String getName() {
             return ;
         }

        

Hidden:
Internal use only.
 
         public Active(String namelong txnIdlong parentId) {
             this. = name;
             this. = txnId;
             this. = parentId;
         }
 
         @Override
         public String toString() {
             return "txnId = " +  + " txnName = " + ;
         }
     }

    
Return the array of active transactions.

Returns:
The array of active transactions.
    public Active[] getActiveTxns() {
        return .getActiveTxnArray();
    }

    
The number of transactions that have aborted.
    public long getNAborts() {
        return .getLong();
    }

    
The number of XA transactions that have aborted.
    public long getNXAAborts() {
        return .getLong();
    }

    
The number of XA transactions that have been prepared.
    public long getNXAPrepares() {
        return .getLong();
    }

    
The number of transactions that are currently active.
    public int getNActive() {
        return .getInt();
    }

    
The number of transactions that have begun.
    public long getNBegins() {
        return .getLong();
    }

    
The number of transactions that have committed.
    public long getNCommits() {
        return .getLong();
    }

    
The number of XA transactions that have committed.
    public long getNXACommits() {
        return .getLong();
    }

    
    @Override
    public String toString() {
        return .toString();
    }
    public String toStringVerbose() {
        return .toStringVerbose();
    }
New to GrepCode? Check out our FAQ X