A combination of
prepare
and
commit
, which can be used by the manager when there is just one participant left to prepare and all other participants (if any) have responded with
NOTCHANGED
. The participant's implementation of this method must be equivalent to:
public int prepareAndCommit(TransactionManager mgr, long id) throws UnknownTransactionException, RemoteException { int result = prepare(mgr, id); if (result == PREPARED) { commit(mgr, id); result = COMMITTED; } return result; }
@param mgr the manager of the transaction
@param id the transaction ID
@return an
int
representing its state
@throws UnknownTransactionException 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.
@throws RemoteException if there is a communication error
@see #prepare
@see #commit