ISCSession Interface

The following table contains information on the ISCSession interface:

Signature

Description

Valid Arguments

VARIANT BeginTransaction()

Opens a transaction on the session. Returns an identifier of the transaction.

None

VARIANT BeginNamedTransaction(BSTR Name, VARIANT PropertyBag [optional])

Opens a transaction on the session with the given name. Returns an identifier of the transaction.

Name � Provides a name for a new transaction.

PropertyBag � Collection of optional parameters for the transaction.

Example 18

The following example illustrates modifying the model using the Begin Transaction in C++. The example uses a Session object from Example 6:

void OpenSession(ISCSessionPtr & scSessionPtr )
{   
    variant_t transactionId;   // transaction ID for the session
    
    VariantInit(&transactionId);
    transactionId = scSessionPtr->BeginTransaction();
    
    // …
}

The following example illustrates modifying the model using the Begin Transaction in Visual Basic .NET. The example uses a Session object from Example 6:

Public Sub OpenSession( ByRef scSession As SCAPI.Session )
    Dim m_scTransactionId As Variant
    
    scTransactionId = scSession.BeginNamedTransaction("My Transaction")
End Sub