EJB Performance Tuning

...

</cmp-field-mapping> <consistency>

<check-version-of-accessed-instances> <column-name>OrderTable.VC_VERSION_NUMBER</column-name>

</check-version-of-accessed-instances> </consistency>

</entity-mapping>

In addition, you must establish a trigger on the database to automatically update the version column when data in the specified table is modified. The Application Server requires such a trigger to use version consistency. Having such a trigger also ensures that external applications that modify the EJB data will not conflict with EJB transactions in progress.

For example, the following DDL illustrates how to create a trigger for the Order table:

CREATE TRIGGER OrderTrigger BEFORE UPDATE ON OrderTable

FOR EACH ROW

WHEN (new.VC_VERSION_NUMBER = old.VC_VERSION_NUMBER) DECLARE

BEGIN

:NEW.VC_VERSION_NUMBER := :OLD.VC_VERSION_NUMBER + 1; END;

Request Partitioning

Request partitioning enables you to assign a request priority to an EJB component. This gives you the flexibility to make certain EJB components execute with higher priorities than others.

An EJB component which has a request priority assigned to it will have its requests (services) executed within an assigned threadpool. By assigning a threadpool to its execution, the EJB component can execute independently of other pending requests. In short, request partitioning enables you to meet service-level agreements that have differing levels of priority assigned to different services.

Request partitioning applies only to remote EJB components (those that implement a remote interface). Local EJB components are executed in their calling thread (for example, when a servlet calls a local bean, the local bean invocation occurs on the servlet’s thread).

To enable request partitioning

1Configure additional threadpools for EJB execution using the Admin Console.

2Add the additional threadpool IDs to the Application Server’s ORB.

You can do this by editing the domain.xml file or through the Admin Console.

Chapter 2 • Tuning Your Application

41

Page 41
Image 41
Sun Microsystems 820434310 manual Request Partitioning, To enable request partitioning, Cmp-field-mapping consistency