To establish an instance of a PowerBuilder COM object, the PowerBuilder virtual machine (PBVM105.DLL) loads the custom class object from the PBD embedded in the COM server DLL and creates the proper session and instance information. When a client invokes a PowerBuilder COM object method, the method calls back into the PowerBuilder virtual machine to execute the appropriate PowerScript code.
PowerBuilder COM servers use the COM single-threaded apartment (STA) model. Runtime sessions can be shared by objects created on the same thread. When a client requests an instance of a PowerBuilder COM object, the PowerBuilder COM server establishes a runtime session and creates an instance of the custom class user object within that runtime session. When the server receives a new request for an instance of a COM object from the same thread, it instantiates the object using the existing runtime session.
In all cases, separate clients use distinct PowerBuilder virtual machine sessions.