dbXML API

## com.dbxml.db.core.transaction
Class Transaction

    java.lang.Object
      com.dbxml.db.core.transaction.Transaction

public final class Transaction
extends java.lang.Object

Transaction

Field Summary
`static int` `ACTIVE`
`static int` `CANCELED`
`static int` `COMMITTED`

Constructor Summary
`Transaction()`
`Transaction(TransactionLog log)`

Method Summary
`void` `addTransactionLog(TransactionLog log)` addTransactionLog adds a TransactionLog to the partipation of this Transaction.
`void` `cancel()` commit ends a transaction by rolling back all data.
`void` `commit()` commit ends a transaction by commiting all data.
`long` `getEndTime()` getEndTime returns the ending time of this Transaction.
`long` `getID()` getID returns the internal ID of this Transaction.
`long` `getStartTime()` getStartTime returns the start time of this Transaction.
`int` `getStatus()` getStatus returns the status of this Transaction.
`int` `hashCode()`

Methods inherited from class java.lang.Object
`equals, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ACTIVE

    public static final int ACTIVE

See Also:
  Constant Field Values

### COMMITTED

    public static final int COMMITTED

See Also:
  Constant Field Values

### CANCELED

    public static final int CANCELED

See Also:
  Constant Field Values

Constructor Detail

### Transaction

    public Transaction()

### Transaction

    public Transaction(TransactionLog log)
                throws DBException

Method Detail

### getID

    public long getID()

  getID returns the internal ID of this Transaction.

  Returns:
    The Transaction ID

### getStatus

    public int getStatus()

  getStatus returns the status of this Transaction.

  Returns:
    The Transaction status

### getStartTime

    public long getStartTime()

  getStartTime returns the start time of this Transaction. The start time is when this Transaction was instantiated, rather than when the first I/O action took place.

  Returns:
    The start time

### getEndTime

    public long getEndTime()

  getEndTime returns the ending time of this Transaction. The end time may return 0 if the Transaction is still active.

  Returns:
    The end time

### commit

    public void commit()
                throws DBException

  commit ends a transaction by commiting all data. This method, in turn, should call the commit methods of all participating Collections' Transaction Logs.

  Throws:
    `DBException`

### cancel

    public void cancel()
                throws DBException

  commit ends a transaction by rolling back all data. This method, in turn, should call the cancel methods of all participating Collections' Transaction Logs.

  Throws:
    `DBException`

### addTransactionLog

    public void addTransactionLog(TransactionLog log)
                           throws DBException

  addTransactionLog adds a TransactionLog to the partipation of this Transaction. This method should invoke the start method of the TransactionLog.

  Throws:
    `DBException`

### hashCode

    public int hashCode()

dbXML API

Copyright (c) 2004 The dbXML Group