A component that can remain active between consecutive method invocations is called a stateful component. A component that is deactivated after each method call and that supports instance pooling is said to be a stateless component. Typically, an application built with stateless components offers the greatest scalability.
Stateful components A stateful component remains active across method calls. EAServer wraps stateful CORBA components with an EJB stateful session bean. To run a CORBA component as stateful, the Stateful Session Bean (com.sybase.jaguar.component.tx_vote) property must be set to true–see “CORBA component property descriptions”.
Since deactivation happens at the mercy of client applications, you may wish to configure the Passivation Timeout property for stateful components so that a client cannot monopolize a component instance indefinitely. See “CORBA component property descriptions” for more information.
Stateless components A is stateless if you disable the component’s Stateful Session Bean property (com.sybase.jaguar.component.tx_vote) —see Table 4-2. You can also set the component’s com.sybase.jaguar.component.tx_vote property to false in an Ant user configuration file. Alternatively, you can implement the component so that it calls either completeWork or rollbackWork in every method.:
Stateless components cannot use instance-specific data to accumulate data between method invocations. Some situations require that you accumulate data across method invocations. For example, a PurchaseOrder component might have an addItem() method that is called repeatedly to specify the contents of an order. In lieu of instance-specific data, you can use one of these alternatives to accumulate data:
Accumulate data in a remote database Use connection caching and database commands to accumulate data in a remote database. This is the preferred technique. If you deploy your component to a cluster, it may run on multiple servers and the database provides a central location available from all servers.
Accumulate data in the client Create a data structure that is passed to each method invocation and contains all accumulated data. This technique is only practical if the amount of data is small. Sending large amounts of data over the network will degrade performance.
Accumulate data in a file If the accumulated data is small and represented by simple data structures, you can store the data in a local file.