public class ServerTransaction extends Object implements Transaction, Serializable
Transaction interface, for use with
 transaction participants that implement the default transaction semantics.Transaction, 
NestableServerTransaction, 
TransactionManager, 
TransactionFactory, 
Serialized FormTransaction.Created| Modifier and Type | Field and Description | 
|---|---|
long | 
id
The transaction id. 
 | 
TransactionManager | 
mgr
The transaction manager. 
 | 
| Constructor and Description | 
|---|
ServerTransaction(TransactionManager mgr,
                 long id)
Simple constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
abort()
Abort the transaction. 
 | 
void | 
abort(long waitFor)
Abort the transaction, waiting for participants to be notified of
 the decision. 
 | 
void | 
commit()
Commit the transaction. 
 | 
void | 
commit(long waitFor)
Commit the transaction, waiting for participants to be notified of
 the decision. 
 | 
boolean | 
equals(Object other)
Two instances are equal if they have the same transaction manager
 and the same transaction id. 
 | 
int | 
getState()
Returns the current state of the transaction. 
 | 
int | 
hashCode()  | 
boolean | 
isNested()
Return true if the transaction has a parent, false if the transaction
 is top level. 
 | 
void | 
join(TransactionParticipant part,
    long crashCount)
Join the transaction. 
 | 
String | 
toString()  | 
public final TransactionManager mgr
public final long id
public ServerTransaction(TransactionManager mgr, long id)
TransactionFactory.mgr - the manager for this transactionid - the transaction idpublic boolean equals(Object other)
public void commit()
            throws UnknownTransactionException,
                   CannotCommitException,
                   RemoteException
TransactionNOTCHANGED
 or the COMMITTED state, without waiting for the
 transaction manager to notify all participants of the decision.
 If the transaction must be aborted (because one or more participants
 are unable to prepare), CannotCommitException is thrown
 without waiting for the transaction manager to notify all participants
 of the decision.commit in interface TransactionUnknownTransactionException - if the transaction is unknown 
         to the manager. This may be because the transaction ID was 
         incorrect, or because the transaction has proceeded to 
         cleanup due to an earlier commit or abort, and has been 
         forgotten.CannotCommitException - if the transaction reaches the ABORTED 
         state, or is known to have previously reached that state due 
         to an earlier commit or abort.RemoteException - if a communication error occurs.public void commit(long waitFor)
            throws UnknownTransactionException,
                   CannotCommitException,
                   TimeoutExpiredException,
                   RemoteException
TransactionNOTCHANGED or the
 COMMITTED state, and the transaction manager has
 notified all participants of the decision, before the specified
 timeout expires.  If the transaction must be aborted (because one
 or more participants are unable to prepare),
 CannotCommitException is thrown if the transaction
 manager is able to notify all participants of the decision before
 the specified timeout expires.  If the transaction manager reaches
 a decision, but is unable to notify all participants of that
 decision before the specified timeout expires, then
 TimeoutExpiredException is thrown.  If the specified
 timeout expires before the transaction manager reaches a decision,
 TimeoutExpiredException is not thrown until the
 manager reaches a decision.commit in interface TransactionwaitFor - timeout to wait, from the start of the call until
 all participants have been notified of the transaction manager's
 decisionUnknownTransactionException - if the transaction is unknown 
         to the manager. This may be because the transaction ID was 
         incorrect, or because the transaction has proceeded to 
         cleanup due to an earlier commit or abort, and has been 
         forgotten.CannotCommitException - if the transaction reaches the ABORTED 
         state, or is known to have previously reached that state due 
         to an earlier commit or abort.TimeoutExpiredException - if the timeout expires before all 
         participants have been notified.RemoteException - if a communication error occurs.public void abort()
           throws UnknownTransactionException,
                  CannotAbortException,
                  RemoteException
Transactionabort in interface TransactionUnknownTransactionException - if the transaction is unknown 
         to the manager. This may be because the transaction ID was 
         incorrect, or because the transaction has proceeded to 
         cleanup due to an earlier commit or abort, and has been 
         forgotten.CannotAbortException - if the transaction is known to have 
         previously reached the COMMITTED state due to an earlier 
         commit.RemoteException - if a communication error occurs.public void abort(long waitFor)
           throws UnknownTransactionException,
                  CannotAbortException,
                  TimeoutExpiredException,
                  RemoteException
TransactionTimeoutExpiredException
 is thrown.abort in interface TransactionwaitFor - timeout to wait, from the start of the call until
 all participants have been notified of the transaction manager's
 decision.UnknownTransactionException - if the transaction is unknown 
         to the manager. This may be because the transaction ID was 
         incorrect, or because the transaction has proceeded to 
         cleanup due to an earlier commit or abort, and has been 
         forgotten.CannotAbortException - if the transaction is known to have 
         previously reached the COMMITTED state due to an earlier 
         commit.TimeoutExpiredException - if the timeout expires before all 
         participants have been notified.RemoteException - if a communication error occurs.public void join(TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
crashCount marks the state of
 the storage used by the participant for transactions. If the
 participant attempts to join a transaction more than once, the crash
 counts must be the same. Each system crash or other event that
 destroys the state of the participant's unprepared transaction storage
 must cause the crash count to increase by at least one.part - the participant joining the transactioncrashCount - the participant's current crash countUnknownTransactionException - if the transaction 
         is unknown to the transaction manager, either 
         because the transaction ID is incorrect or because the 
         transaction is complete and its state has been 
         discarded by the manager.CannotJoinException - if the transaction is known 
         to the manager but is no longer active.CrashCountException - if the crash count provided 
         for the participant differs from the crash count 
         in a previous invocation of the same pairing of 
         participant and transactionRemoteException - if there is a communication errorpublic int getState()
             throws UnknownTransactionException,
                    RemoteException
TransactionConstants values.int representing the state of the transactionUnknownTransactionException - if the transaction 
         is unknown to the transaction manager, either 
         because the transaction ID is incorrect or because the 
         transaction is complete and its state has been 
         discarded by the manager.RemoteException - if there is a communication errorTransactionConstantspublic boolean isNested()