Previous Topic: ISCPropertyValueCollection::RemoveFacet ArgumentsNext Topic: ISCSession::BeginNamedTransaction Arguments


ISCSession

The ISCSession interface is an active connection between the API client and a model.

The following table contains the methods for the ISCSession interface:

Method

Description

VARIANT BeginTransaction()

Opens a transaction on the session. The method passes back a transaction identifier. Implementations use the identifier to scope Commit and Rollback operations. If the application does not support nested transactions, it passes back VT_EMPTY.

Transaction nesting is implicit. If an API client invokes BeginTransaction and a transaction is already open, the new transaction is nested inside the existing one.

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

Opens a transaction on the session. Similar to BeginTransaction with an option to provide a transaction name and additional properties.

VARIANT_BOOL ChangeAccess(SC_SessionFlags Flags)

Changes the model access to the specified level.

VARIANT_BOOL Close()

Disconnects self from its associated persistence unit or model set.

VARIANT_BOOL CommitTransaction(VARIANT TransactionId)

Commits the specified transaction and all nested transactions contained within it.

SC_SessionFlags Flags()

Returns a set of flags associated with the session.

VARIANT_BOOL IsValid()

Returns TRUE if self is valid.

VARIANT_BOOL IsTransactionEmpty( VARIANT All [optional] )

TRUE if there was no data modification applied from the beginning of the outer transaction or for the duration of the current transaction.

Returns TRUE with no open transaction present.

SC_SessionLevel Level()

Returns the level at which the persistence unit or model is bound.

This value is valid only if the session is open.

VARIANT_BOOL IsOpen()

TRUE only if the session is open.

ISCModelObjectCollection * ModelObjects()

Creates a ModelObject collection for the session.

The returned collection contains every object associated with the persistence unit or model set.

SC_MODELTYPEID ModelSetId()

Passes back an identifier for the model set associated with the session.

BSTR Name()

Name of the associated persistence unit or model set.

Contains a valid name only when self is in the Opened state.

VARIANT_BOOL Open(IUnknown * Target, VARIANT Level [optional], VARIANT Flags [optional])

Binds to the persistence unit, model set, or intrinsic metamodel identified by the Target parameter.

ISCPersistenceUnit * PersistenceUnit()

Persistence unit associated with the session. Contains a valid pointer only when it is in the Opened state.

long TransactionDepth()

Returns the current depth level of the nested transaction. Returns zero if there are no active transactions present.

Note: More property information about the BeginNamedTransaction method is located in the Property Bag for Session section. More information about SC_SessionFlags and SC_SessionLevel is located in the Enumerations section.