Component properties: Instances

Properties on the Instances tab configure how instances of the component are created and bound to server-side threads and client-side object references. Table 4-2 describes the settings:

Table 4-2: Instances tab component properties

Property

Description

Concurrency

Enabling this option allows multiple method invocations to occur simultaneously. Concurrent access can decrease the response time of client method invocations. Enable this option for any component that is thread safe.

If this option is disabled, EAServer serializes all method calls to the component.

Concurrency applies to execution of all instances. With concurrency disabled, a call to one instance cannot overlap the execution of another instance.

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

Bind Object

Applies to stateful components only (Automatic Demarcation/Deactivation must be disabled on the Transactions tab or the component must be a stateful session EJB). When this property is enabled, an instance is bound to a client's proxy reference until the client destroys or releases the reference.

If you enable this option, your component must be thread-safe; that is, one instance must be able to execute on multiple threads concurrently. A client may call the proxy from multiple threads, or pass the proxy to another process or component; consequently, there is no guarantee that calls are serialized with Bind Object enabled.

Component instances are destroyed when the client instance reference times out (the time out period is configured on the Instances tab–see “Component properties: Instances”). Instances are not pooled.

Bind Object is most commonly used for storage components, which are used to store a component’s state information in a database. See “Component properties: Persistence” for more information on storage components.

Bind Thread

When this option is enabled, component instances are bound to the creating thread. Enable this option if the component uses thread-local storage. For ActiveX components, this option must be enabled. For other component types, enable the option only if you are sure that your component uses thread-local storage.

If the Bind Thread option is selected, multiple instances may still run concurrently on separate threads. To ensure that only one instance is active at a time, make sure that the Concurrency option is not selected.

When Bind Thread is enabled, instances are pooled if the Pooling option is enabled. The thread is pooled with the instance in this case.

Pooling

When this option is enabled, component instances are always pooled after deactivation. For Java and ActiveX components, you can also configure pooling by implementing interfaces with a canReuse (Java) or canBePooled (ActiveX) method. If you enable the Pooling option in EAServer Manager, your component is always pooled, and these methods are not called. See “Supporting instance pooling in your component” for more information on instance pooling.

Sharing

When this option is enabled, a single, shared instance of the component 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.

Stateless

This option applies only to EJB session Beans and non-EJB components that use the control interface CtsComponents::ObjectControl. For EJB session Beans, the Stateless option is set correctly when the component type is set, and must not be changed. For other component types, the option must be set manually.

External Server

If selected, the component executes externally in the specified server. See “Running components externally”.

External Server/Name

When running the component externally, the name of the external server that hosts the component. The external server must run on the same machine as the server that your application’s clients connect to.

External Server/ Request Timeout

When running the component externally, specifies how long, in seconds, to wait for a response from the external server before returning an error to the client. The default value is set in the server properties for the server where the component is installed.

External Server/ Server Start Timeout

When running the component externally, specifies how long, in seconds, to wait for the external server to start if it is not already running. EAServer returns an error to the client if the external server does not start in the specified time. The default value is set in the server properties for the server where the component is installed.

Transient

Applies to stateful components only. Specifies whether instances can be run on multiple servers in a cluster or survive a server restart. If this option is enabled, the server guarantees that proxy references can only be used within the same server process. For EJB stateful session Beans, this property must be enabled for the standard EJB passivation and activation to occur. It must be disabled if you want to configure a stateful session bean to support failover using the Persistence tab properties (see “Component properties: Persistence”).

Reentrant

Applies to entity components only (including EJB entity Beans). When this option is enabled, an instance is allowed to participate in loopback call sequences, which are call sequences where one of the bean’s methods calls another component which in turn calls a method in the calling bean instance. Most Beans are not implemented to support reentrancy, and you must not enable this option unless the bean developer has verified that the implementation allows it.

LWC

Applies to EJB components only. Enables the EAServer lightweight container (LWC) for intercomponent EJB invocations or calls to EJBs from servlets and JSPs hosted in the same server. For more information, see “Lightweight container” in the EAServer Performance and Tuning Guide.

LWC/ Skeleton Support

If LWC is enabled, the Skeleton Support option enables calls to the component from servlets and JSPs hosted in the same server. Such calls are not supported unless this option is set.