The Current
pseudo-object is used to handle transactions on the client side. This section describes CosTransactions::Current
.
Listing 4-1 Definition for CosTransactions::Current Interface
interface Current {
void begin () raises (SubtransactionsUnavailable);
void commit (in boolean report_heuristics)
raises (NoTransaction, HeuristicMixed, HeuristicHazard);
void rollback () raises (NoTransaction);
void rollback_only () raises (NoTransaction);
Status get_status ();
Control suspend ();
void resume(in Control tran) raises (InvalidControl);
void set_timeout (in unsigned long seconds);
}
The following code listing shows the methods of Current
in Visual Basic syntax.
Listing 4-2 Methods for Current in Visual Basic Syntax
Public Sub begin(Optional ByRef exceptionInfo As VARIANT)
Public Sub commit( _
ByVal report_heuristics As Boolean, _
Optional ByRef exceptionInfo As VARIANT)
Public Sub rollback(Optional ByRef exceptionInfo As VARIANT)
Public Sub rollback_only(Optional ByRef exceptionInfo As VARIANT)
Public Function get_status(Optional ByRef exceptionInfo As VARIANT) As Integer
Public Function get_control (Optional ByRef exceptionInfo As VARIANT) As
DICosTransactions_Control
Public Function suspend(Optional ByRef exceptionInfo As VARIANT) As DICosTransactions_Control
Public Sub resume( _
ByVal tran As DICosTransactions_Control, _
Optional ByRef exceptionInfo As VARIANT)
Public Sub set_timeout( _
ByVal seconds As Long, _
Optional ByRef exceptionInfo As VARIANT)
The enumerated values that can be returned by get_control()
are defined as matching constants for each OLE Automation controller ADE (for example, as Const
in Visual Basic). The exceptions raised by methods of Current
are returned using the optional exceptionInfo
parameter.
Table 4-1 describes each operation of Current
as implemented in the Active Expert.
The Control
Control
pseudo-object is used to explicitly manage the transaction as opposed to relying on the Transaction Manager. The only purpose of Control
in the Active Expert is to act as a handle for the active transaction context for the suspend()
and resume()
operations of Current
.