|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Current interface defines methods that allow a client of the Transaction Service to explicitly manage the association between threads and transactions. This interface also defines methods that simplify the use of the Transaction Service for most applications. These methods can be used to demarcate transactions, to suspend/resume transactions, and to obtain information about the current transaction.
Method Summary | |
void |
begin()
Creates a new transaction. |
void |
commit(boolean report_heuristics)
Completes the current transaction. |
Control |
get_control()
If the client is associated with a transaction, a Control object is returned that represents the transaction context currently associated with the client thread. |
Status |
get_status()
If there is a transaction associated with the client thread, this method returns the status of the transaction associated with the client thread. |
java.lang.String |
get_transaction_name()
If there is a transaction associated with the client thread, this method returns a printable string describing the transaction (specifically the XID as specified by the Open Group). |
void |
resume(Control which)
If the parameter is a valid object reference in the current execution environment, the client thread becomes associated with that transaction (in place of any previous transaction). |
void |
rollback_only()
If there is a transaction associated with the client thread, it is modified so that the only possible outcome is to roll back the transaction. |
void |
rollback()
Rolls back the current transaction. |
void |
set_timeout(int seconds)
This method modifies a state variable associated with the target object that affects the time-out period associated with transactions created by subsequent invocations of the begin method. |
Control |
suspend()
If in a proper context with a transaction not marked ROLLEDBACK, an object is returned that represents the transaction context currently associated with the client thread. |
Methods inherited from interface org.omg.CORBA.Object |
_create_request,
_create_request,
_duplicate,
_get_domain_managers,
_get_interface_def,
_get_policy,
_hash,
_is_a,
_is_equivalent,
_non_existent,
_release,
_request,
_set_policy_override |
Method Detail |
public void begin() throws SubtransactionsUnavailable
If the client thread is currently associated with a transaction, the SubtransactionsUnavailable exception is raised.
If the client thread cannot be placed in transaction mode due to an error while starting the transaction, the org.omg.CORBA.INVALID_TRANSACTION standard system exception is raised.
If the call was made in an improper context, the org.omg.CORBA.BAD_INV_ORDER standard system exception is raised.
public void commit(boolean report_heuristics) throws NoTransaction, HeuristicMixed, HeuristicHazard
If the call was made in an improper context, the standard system exception org.omg.CORBA.BAD_INV_ORDER is raised.
If the system decides to roll back the transaction, the standard system exception org.omg.CORBA.TRANSACTION_ROLLEDBACK is raised and the thread's transaction context is set to null.
An org.omg.CosTransactions.HeuristicMixed exception is raised to report that a heuristic decision was made and that some relevant updates have been committed and others have been rolled back. A HeuristicHazard exception is raised to report that a heuristic decision was made, and the disposition of all relevant updates is not known. For those updates whose disposition is known, either all have been committed or all have been rolled back. The HeuristicMixed exception takes priority over the HeuristicHazard exception. If a heuristic exception is raised or the operation completes normally, the thread's transaction context is set to null.
public void rollback() throws NoTransaction
If there is no transaction associated with the client thread, the org.omg.CosTransactions.NoTransaction exception is raised.
If the call was made in an improper context, the standard system exception org.omg.CORBA.BAD_INV_ORDER is raised.
If the operation completes normally, the thread's transaction context is set to null.
public void rollback_only() throws NoTransaction
public Status get_status()
public java.lang.String get_transaction_name()
public void set_timeout(int seconds)
If the time-out period is not defined, the M3 system uses a default value, which is specified in the UBBCONFIG file. For more information, see the description of the TIMEOUT parameter in the Administration Guide.
Note: The initial transaction timeout value is 300 seconds. If a transaction is started via AUTOTRAN instead of via the begin method, the timeout value is determined by the TRANTIME value in the M3 configuration file. For more information, refer to Chapter 7 of the Administration Guide.
public Control get_control()
public Control suspend()
If the associated transaction is in a state such that the only possible outcome of the transaction is to be rolled back, the org.omg.CORBA.TRANSACTION_ROLLEDBACK standard system exception is raised and the client thread becomes associated with no transaction.
If the call was made in an improper context, the standard system exception org.omg.CORBA.BAD_INV_ORDER is raised. The caller's state with respect to the transaction is not changed.
Note: As defined in The Common Object Request Broker: Architecture and Specification, Revision 2.2, February 1998, the org.omg.CORBA.TRANSACTION_ROLLEDBACK standard system exception indicates that the transaction associated with the request has already been rolled back or has been marked to roll back. Thus, the requested method either could not be performed or was not performed because further computation on behalf of the transaction would be fruitless.
public void resume(Control which) throws InvalidControl
If the call was made in an improper context, the standard system exception org.omg.CORBA.BAD_INV_ORDER is raised.
If the system is unable to resume the global transaction because the caller is currently participating in work outside any global transaction with one or more resource managers, the org.omg.CORBA.INVALID_TRANSACTION standard system exception is raised.
Note: See suspend for a definition of the org.omg.CORBA.TRANSACTION_ROLLEDBACK standard system exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |