Each shared object has its own session
At execution time, PowerBuilder creates a separate thread (session) for each shared object instance and any objects that the shared object creates. The thread for a shared object is created using the Application object definition for the server application.
The shared object session has its own copy of the application's global variables; however the events for the Application object are not triggered. Therefore, if you want the shared object to perform any setup operations (such as initializing variables), you need to code these operations in the Constructor event of the shared object because the Open and ConnectionBegin events of the Application object will not be fired.
Requests are queued
As client make requests for shared object services, these requests are sequentially queued to avoid problems that might arise from concurrent access. This ensures that only one user can modify the contents of a shared object at a time.
Execution time errors are passed back to the client
If an execution time error occurs while a shared object instance is being used, the error is passed back to the client. If a fatal system error occurs in the server, the error is passed back to the client as a fatal error.
How shared objects are destroyed
A shared object instance is deleted when any of the following events takes place:
- The server application unregisters the object's named instance and no more references to the object exist.
- The object is explicitly destroyed with a DESTROY statement.
- The server application shuts down.
The shared object instance is not destroyed when a reference to the shared object is implicitly destroyed by the PowerBuilder garbage collector.
|