Hitachi

uCosminexus Application Server Expansion Guide


2.7.4 How to use a resource adapter

When connecting to resources by using a resource adapter, deploy the resource adapter as a J2EE resource adapter. A J2EE resource adapter is the resource adapter deployed on a J2EE server. For details on how to deploy the resource adapters, see 3.3.7 How to set up a resource adapter in the uCosminexus Application Server Common Container Functionality Guide.

Organization of this subsection

(1) Resource adapter functionality

The following table describes the functionality that you can use for connecting to a database, in the case of a batch server. For details on the functionality, see description at respective Reference location.

Table 2‒21: Resource adapter functionality

Functionality

Field

Explanation

Reference manual#1

Reference location

Functionality for performance tuning

Connection pooling

You can speedily process connection requests from the application by pooling the connections in memory.

Common Container Functionality Guide

3.14.1

Warm-up of connection pool

Create connections of the number that is specified when you start a server or a resource adapter. By pooling the connections, speedily process the connection requests immediately after starting the connection pool.

3.14.2

Functionality for adjusting number of connections

This functionality gradually decreases unnecessary connections in the pool, at regular intervals.

3.14.2

Connection sharing association

By sharing connections, you can decrease the processing time required for acquiring connections.

In connection sharing, connect logical connections and physical connections that are the connections of the connection destination resources, as many-to-one.

However, you cannot use connection association in a batch application.

3.14.3

Statement pooling

In the processing that uses PreparedStatement and CallableStatement, you can pool these statements and shorten the processing time required for creating the same statements.

3.14.4

Caching of DataSource objects

When making search request of DataSource type object by using JNDI interface, you can cache DataSource objects.

3.14.7

Optimizing sign-on in container management of DB Connector

If you want to perform sign-on in container management, you can optimize on the sign-on operation.

3.14.8

Functionality for fault tolerance

Detecting connection failure

You can detect whether trouble has occurred in pooled connections. As a result, you can return only valid connections against connection requests from user program.

Common Container Functionality Guide

3.15.1

Waiting for acquiring connections when connections exhaust

You can set up the connection acquisition requests to standby if connections of the specified maximum value are pooled in the connection pool and there are no connections that you can use.

3.15.2

Retrying connection acquisition

If there are no connections that you can use, in the connection pool, or if establishing a physical connection of connection destination resource fails, you can automatically re-execute the processing of acquiring connection.

3.15.3

Displaying connection pool information

You can display connection information in the connection pool using a command.

3.15.4

Clearing connection pool

If trouble occurs on a database server and the connection is disconnected, you can delete the unnecessary connection pools with a command.

3.15.5

Cancelling statements

You can cancel a statement if transaction timeout occurs when the running SQL processing has not returned.

3.15.8

Outputting SQL for failure investigation

If failure such as deadlock and slowdown occurs, you can output the issued SQL to log. You can use the log for analyzing the cause of failure.

3.15.10

Automatic closing of objects

If you could not close the Statement objects opened by user program, DB Connector can automatically close the objects.

3.15.11

Testing connection to resources

Testing connection to resources

You can check whether a resource adapter is correctly specified during the environment setup.

3.17

Assigning optional name to Enterprise Bean or J2EE resources (user-specified namespace functionality)

Assigning optional name to J2EE resource#2

You can assign optional name to J2EE resources. You can perform lookup from batch application, on any name specified as an optional name.

2.6

Performance analysis of system by using performance analysis trace

PRF trace of connection ID

This functionality collects performance analysis information output by the functionality. Based on this information, you can analyze system performance and bottlenecks.

Maintenance and Migration Guide

Chapter 8

#1 uCosminexus Application Server is omitted in the manual name mentioned in the Reference manual column.

#2 For a batch server, make sure to use the optional name of the resource adapter.

The following table describes functionality that you can use for each type of resource adapter.

Table 2‒22: Functionality that you can use for each type of resource adapter

Functionality

Field

Type of resource adapter

DB Connector

Functionality for performance tuning

Connection pooling

Y

Warm-up of connection pool

Y

Functionality for adjusting number of connections

Y

Connection sharing association#

Y

Statement pooling

Y

Caching of DataSource objects

Y

Optimizing sign-on in container management of DB Connector

Y

Functionality for fault tolerance

Detecting connection failure

Y

Waiting for acquiring connections when connections exhaust

Y

Retrying connection acquisition

Y

Displaying connection pool information

Y

Clearing connection pool

Y

Cancelling statements

Y

Outputting SQL for failure investigation

Must be enabled

Automatic closing of objects

Y

Testing connection to resources

Testing connection to resources

Y

Assigning optional name to Enterprise Bean or J2EE resources (user-specified namespace functionality)

Assigning optional name to J2EE resource#

Y

Performance analysis of system by using performance analysis trace

PRF trace of connection ID

Y

Legends:

Y: Can be used

# You cannot use connection association with a batch application.

(2) Functionality other than resource adapter

This subsection describes the functionality other than the implemented resource adapters. You can use the functionality described here irrespective of the type of resource adapter.

The following table describes the functionality other than the implemented resource adapters. For details on the functionality, see Reference location.

Table 2‒23: Functionality other than resource adapter

Functionality

Field

Explanation

Reference manual#

Reference location

Functionality for performance tuning

Light transaction

This functionality provides an environment optimized with local transactions. Make sure to enable the light transaction functionality.

Common Container Functionality Guide

3.14

Functionality for fault tolerance

Transaction timeout

This functions rolls back the transactions at invoke destination when a fixed time elapses after transaction start time.

Common Container Functionality Guide

3.15

# uCosminexus Application Server is omitted in the manual name mentioned in Reference location.

Important note

The transaction management functionality on a J2EE server includes the functionality for automatically concluding transactions. However, you cannot use the functionality of automatically concluding transactions on a batch server.

(3) Notes for optional name of resource adapter

If you have deployed multiple resource adapters with the same optional name, an error message is output and an attempt to start the resource adapters fails.