Pooling and statement caching – HP Integrity NonStop H-Series User Manual

Page 67

Advertising
background image

Table 19 Elements of DataSource configuration

Description

Elements

This element defines a datasource. The following are some of the attributes of this
element:

jta:

Setting this attribute to true makes the DataSource participate in a

JTA transaction. The default value is true. If set to false, the DataSource
does not participates in the JTA transaction. This can be particularly useful in
NSASJ and SQL/MX T4 when the useExternalTransaction attribute is
set. When useExternalTransaction is set to true, then this attribute (jta)
can be set to false.

When useExternalTransaction is set to true, the connection expects
and uses the TMF transaction context present at the time of executing
statements.

In NSASJ, when an EJB is invoked within a JTA transaction context, there is
always a TMF transaction context. Hence, it is of not much use by making
the DataSource participate in the JTA transaction while the driver
participates in the TMF context.

datasource

This is the name of the driver deployment. The value is the name of the jar that is
deployed. For example, t4sqlmx.jar. When the driver element is mentioned,
the container picks the driver class name from the driver deployment.

driver

This element can be used for driver specific properties that are used while creating
new connections. The SQL/MX JDBC manual lists all valid properties for the T2
and T4 drivers.

connection-property

This element can be used to execute SQL statements when a new connection is
obtained. This feature can be particularly useful when using JDBC T4 driver. If an

new-connection-sql

SQL statement is executed as part of the new connection creation procedure, then
the corresponding executor process also gets started. This prevents any delays that
can occur due to start of an SQL executor process when the actual business
statements are executed.

This element is used to configure connection pool. The connections can be pooled
either by the driver itself or the container can be configured to pool connections.

pool

The section on

“Pooling and statement caching” (page 67)

explains how to achieve

pooling at different levels.

By default, the statements are not cached even when connection pooling is enabled.
This element configures statement caching.

statement

Pooling and statement caching

The following list provides various information on pooling and statement caching:

1.

Connections can be pooled either by the driver or by the container.

2.

Driver pooling

The connection properties such as initialPoolSize, minPoolSize, and
maxPoolSize

can be used to pool connections at the driver.

For more information on connection properties and information on pooling, see SQLMX
JDBC manual
.

Statement caching can be enabled using the maxStatement connection property. For
more information, see the JDBC Type 4 Driver Programmer's Reference for SQL/MX
Release 3.2.1
.

3.

Container pooling

The DataSource definition provided by the container also provide features to pool
connections.

The datasources/datasource/pool element is used to configure connection pooling.

DataSource configuration

67

Advertising
This manual is related to the following products: