Overview | Requests that the transaction be committed. |
Original interface | CosTransactions::Terminator Interface |
Exceptions | HeuristicHazard |
HeuristicMixed | |
TransactionRolledBack standard exception |
Intended Usage
If the transaction has not been marked as rollback-only, and all the participants in the transaction agree to commit, the transaction is committed, and the operation terminates normally. Otherwise, the transaction is rolled back and the standard TransactionRolledBack exception is raised.
If the report_heuristics parameter is true, the transaction framework reports inconsistent or possibly-inconsistent outcomes using the HeuristicMixed or HeuristicHazard exceptions.
The commit operation can rollback the transaction if there are existing or potential activities associated with the transaction that have not completed.
When a top-level transaction is committed, all changes to transactional objects made in the scope of this transaction are made permanent and visible to other transactions or clients.
Note that the suspend operation of the CosTransactions::Current Interface must be used to suspend an active transaction before the commit operation of the Terminator interface is used to commit the transaction.
Syntax
void commit(in boolean report_heuristics) raises(HeuristicMixed, HeuristicHazard);
Input parameters
Return values
None.
Examples
The following examples demonstrate the usage of CosTransactions::Terminator::commit.
C++ Example
{ try { CosTransactions::Control_var control; CosTransactions::Terminator_var term; ..... control = current->suspend(); term = control->get_terminator(); term->commit(TRUE); } catch ( ......... }