org.h2.log
Class InDoubtTransaction

java.lang.Object
  extended by org.h2.log.InDoubtTransaction

public class InDoubtTransaction
extends java.lang.Object

Represents an in-doubt transaction (a transaction in the prepare phase).


Field Summary
static int COMMIT
          The transaction state meaning this transaction is committed.
static int IN_DOUBT
          The transaction state meaning this transaction is not committed yet, but also not rolled back (in-doubt).
static int ROLLBACK
          The transaction state meaning this transaction is rolled back.
 
Constructor Summary
InDoubtTransaction(PageStore store, LogFile log, int sessionId, int pos, java.lang.String transaction, int blocks)
          Create a new in-doubt transaction info object.
 
Method Summary
 java.lang.String getState()
          Get the state of this transaction as a text.
 java.lang.String getTransaction()
          Get the name of the transaction.
 void setState(int state)
          Change the state of this transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IN_DOUBT

public static final int IN_DOUBT
The transaction state meaning this transaction is not committed yet, but also not rolled back (in-doubt).

See Also:
Constant Field Values

COMMIT

public static final int COMMIT
The transaction state meaning this transaction is committed.

See Also:
Constant Field Values

ROLLBACK

public static final int ROLLBACK
The transaction state meaning this transaction is rolled back.

See Also:
Constant Field Values
Constructor Detail

InDoubtTransaction

public InDoubtTransaction(PageStore store,
                          LogFile log,
                          int sessionId,
                          int pos,
                          java.lang.String transaction,
                          int blocks)
Create a new in-doubt transaction info object.

Parameters:
store - the page store
log - the log file
sessionId - the session id
pos - the position
transaction - the transaction name
blocks - the number of blocks the 'prepare commit' entry occupies
Method Detail

setState

public void setState(int state)
              throws java.sql.SQLException
Change the state of this transaction. This will also update the log file.

Parameters:
state - the new state
Throws:
java.sql.SQLException

getState

public java.lang.String getState()
Get the state of this transaction as a text.

Returns:
the transaction state text

getTransaction

public java.lang.String getTransaction()
Get the name of the transaction.

Returns:
the transaction name