Generic issues

Common application problems for all component types include:

Non-threadsafe sleep calls Cause the server, instead of a specific thread, to sleep. Always use jagsleep().

User-spawned threads Use EAServer Thread Manager to allow EAServer to manage threads that must be spawned by a component.

ResultSets You must explicitly free the structures that you use to process result sets. A ResultSet object is closed only when the Statement object that generated it is closed.

Shared components A single shared component instance services all client requests. A shared component can store data in instance variables. However, if the component’s Concurrency option is also selected, you must add code to synchronize access to instance variables.

If a PowerBuilder component is Shared, disable Concurrency. PowerBuilder is thread safe at the session level only.

Lack of error handling Code that does not check for errors, and invalid object references and calls are common problems. For more information, see Chapter 4, “Exception Handling.”

No timeout on stateful components, or no remove() to disconnect the client proxy Before destroying the client proxy, deactivate the component instance using the SetComplete method. Do not leave a component instance bound to the client without a reference to it.

Variables holding references Set variables that hold references to null, particularly pooled components or connections.