Platform SDK: Transaction Server

Scenario: Adding Just-In-Time Activation to the Account Component

[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]

In this scenario, the Bank client creates an Account object from the Account component and calls its Post method, just as in Creating a Simple ActiveX Component. This time, Account obtains a reference to its context object. When it successfully completes its work on behalf of the client, it uses its context object to call SetComplete. If Account encounters an error and is unable to complete its work successfully, it uses its context object to call SetAbort. When Account calls either SetComplete or SetAbort, it indicates that it's finished with its work and that it doesn't need to maintain any private state for its client. This allows the MTS run-time environment to reclaim and reuse the Account object's resources.

See Also

Context Objects, Deactivating Objects, Application Design Notes: Just-In-Time Activation, GetObjectContext method, SetAbort method