|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.tm.Journal
Abstract class for transactional journal.
This class supports journaling of two-phase commit transactions, recording both prepare, commit, rollback and conslution of transactions.
A complete transaction is one for which XAResource.forget has
been called. The transaction manager is not interested in recovering
complete transactions. During journaling this is indicated by the
forget
method which closes the transaction chain.
During recovery this is indicated by the complete flag and the
completed
method.
During recovery, the outcome of every recovered transaction must be recorded in the journal to close the transaction chain. Complete transaction must not be recorded, as the chain has already been closed.
Transaction journaling is only required when the resource manager participates in a distributed transaction. Local transactions are never recovered and need not be recorded in the journal.
If the transaction completes by one-phase commit or rolling back in lieu of two-phase commit, the transaction manager will not attempt to recover the transaction. In this case, it is unnecessary to record the transaction, unless a heuristic decision has been reached.
When performing two-phase commit, the outcome of the prepare stage must be recorded, followed by the concluing commit or rollback of the transaction. If an error occured before the transaction is forgotten, the transaction should be recovered.
Nested Class Summary | |
static class |
Journal.RecoveredTransaction
Provides information about a recovered transaction. |
Constructor Summary | |
Journal()
|
Method Summary | |
abstract void |
close()
Called to close the journal and release any resources held by the journal. |
abstract void |
commit(javax.transaction.xa.Xid xid,
int decision)
Records a transaction commit. |
abstract void |
forget(javax.transaction.xa.Xid xid)
Forgets a heuristically complete transaction. |
abstract void |
prepare(javax.transaction.xa.Xid xid,
int decision)
Records the outcome of transaction preparation. |
abstract Journal.RecoveredTransaction[] |
recover()
Called to initiate recovery. |
abstract void |
rollback(javax.transaction.xa.Xid xid)
Records a transaction rollback. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Journal()
Method Detail |
public abstract void prepare(javax.transaction.xa.Xid xid, int decision) throws javax.transaction.SystemException
This method is called to record the outcome after preparing a transaction. It must record a decision to commit or rollback the transaction. This method may be skipped if the transaction is identified as read-only or for local transactions.
If this method is called, commit
or rollback
must follow.
Valid values for the decision are XAResource.XA_OK, XAResource.XA_RDONLY, or any of the heuristic codes defined by XAException.XA_HEUR*.
xid
- The transaction identifierdecision
- The outcome of the prepare stage
javax.transaction.SystemException
public abstract void commit(javax.transaction.xa.Xid xid, int decision) throws javax.transaction.SystemException
This method is called when completing two-phase commit of a transaction branch. This method may be skipped if the transaction is identified as read-only or is a local transaction.
If this method is called, forget
must follow.
If the transaction has properly committed, the heuristic decision will be XAResource.XA_HEURCOM. Otherwise, use any of the heuristic codes defined by XAException.XA_HEUR*.
xid
- The transaction identifierdecision
- The heuristic decision
javax.transaction.SystemException
public abstract void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.SystemException
This method is called when completing two-phase commit of a transaction branch. This method may be skipped for local transactions.
If this method is called, forget
must follow.
xid
- The transaction identifier
javax.transaction.SystemException
public abstract void forget(javax.transaction.xa.Xid xid) throws javax.transaction.SystemException
This method is called when completing two-phase commit to discard the transaction and close the transaction chain.
xid
- The transaction identifier
javax.transaction.SystemException
public abstract Journal.RecoveredTransaction[] recover() throws javax.transaction.SystemException
A recoverable transaction is a transaction that has been processed through two-phase commit but has not been completed. This method will return the heuristic decision for the transaction as reached by the transaction manager.
Transactions that have been completed are generally not returned by this method. In addition it is possible that resource managers will return additional transaction branchs for which the transaction manager has not reached any heuristic decision.
javax.transaction.SystemException
public abstract void close() throws javax.transaction.SystemException
javax.transaction.SystemException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |