XU services for resource management

The XU manages resources through services such as work management, connection management, lifecycle management, and resource adapter configuration.

The XU collaborates with the resource adapter container to manage resources. When the XU is deployed as a Java™ EE resource adapter in an application server, the resources are managed by the application server. When a Java SE rule session is used, the XU manages the resources by itself, and uses its own resource adapter container.

Connection management
The capability of pooling connections is important to create a scalable application environment, particularly when large numbers of clients access the underlying rule engines. Each stateful rule session uses a dedicated XU connection, which can be reused. Each XU connection is associated with a dedicated rule engine and a ruleset. The rulesets are shared between XU connections. By default, the rulesets are removed from the cache when they are no longer referenced by a connection and their maximum idle time is reached. The XU then must read the ruleset from the persistence layer instead. The resource adapter container implements the connection pooling strategy and reuses, removes, or creates connections. For more information, see Managing the maximum idle time of rulesets.
Transaction management

A transaction is a set of operations that must be either committed all together or not committed at all to maintain data consistency and integrity.

The XU does not provide transaction management itself. However, it does not prevent the execution of a ruleset from registering a transaction resource into the transaction scope. Typically, database operations that are triggered by the execution of a ruleset can use transactions even if the XU does not support transactions.

Lifecycle management
The XU lifecycle is managed by the resource adapter container.
Work management
The XU uses the work manager that is provided by the resource adapter container. Therefore, the application server can pool threads efficiently and have more control over its runtime environment. The management plug-in uses work instances for asynchronous execution and asynchronous parsing.