Invoking another server component’s methods

COM+ allows the methods of one server component to call methods of another. The other server component does not need to be another PowerBuilder component; it can be implemented in any language supported by COM+.

Using an OLEObject object

To access methods of another component, declare a variable of type OLEObject and call the ConnectToNewObject function to connect to the component, just as you would when calling the component from a client. ConnectToNewObject inherits the server object’s transaction context automatically.

Using a TransactionServer object

To access methods of another component in the current server, you can also use the transaction service context object that PowerBuilder provides called TransactionServer. The TransactionServer interface provides a method called CreateInstance that allows you to access other components that are available locally. CreateInstance uses the same user and password information that applies to the component from which it is called.