...
</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 specied table is modied. 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 conict 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 exibility 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 diering levels of priority assigned to
dierent 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
Congureadditional threadpools forEJB execution usingthe Admin Console.
Add theadditional threadpool IDs tothe Application Server’s ORB.
You can do this by editing the domain.xml le or through the Admin Console.
1
2
EJB PerformanceTuning
Chapter2 • TuningYourApplication 41