4.3.1.22 Transaction

4.3.1.22.1 Synopsis
4.3.1.22.2 begin()
4.3.1.22.3 commit()
4.3.1.22.4 getRollbackOnly()
4.3.1.22.5 isActive()
4.3.1.22.6 rollback()
4.3.1.22.7 setRollbackOnly()

Transaction represents a user transaction active in the cluster.

4.3.1.22.1 Synopsis
 public interface Transaction {
// Public Methods  public abstract void begin();
  public abstract void commit();
  public abstract boolean getRollbackOnly();
  public abstract boolean isActive();
  public abstract void rollback();
  public abstract void setRollbackOnly();
}

Figure 4.21 Transaction Class

Transaction Class

4.3.1.22.2 begin()
public abstract void begin();

Begin a transaction.

4.3.1.22.3 commit()
public abstract void commit();

Commit a transaction.

4.3.1.22.4 getRollbackOnly()
public abstract boolean getRollbackOnly();

Has this transaction been marked for rollback only?

Parameters

return

true if the transaction has been marked for rollback only

4.3.1.22.5 isActive()
public abstract boolean isActive();

Is there a transaction currently active?

Parameters

return

true if a transaction is active

4.3.1.22.6 rollback()
public abstract void rollback();

Roll back a transaction.

4.3.1.22.7 setRollbackOnly()
public abstract void setRollbackOnly();

Mark this transaction as rollback only. After this method is called, commit() will roll back the transaction and throw an exception; rollback() will roll back the transaction and not throw an exception.