Hitachi

uCosminexus Application Server Expansion Guide


6.6.4 DB Connector settings

When using the database session failover functionality, create a new DB Connector apart from the one used in an application. You need to create one DB Connector for each J2EE server. Use the same DB Connector for all applications that use the database session failover functionality.

For details on the procedures from importing to starting a DB Connector, see 4.2 Settings for connecting to the database in the uCosminexus Application Server Application Setup Guide.

This section describes the following settings required for DB Connector to be used in the database session failover functionality:

Organization of this subsection

(1) Setting transaction support level

With the database session failover functionality, you must set transaction support levels. Specify NoTransaction in the <transaction-support> tag under the <hitachi-connector-property>-<resourceadapter>-<outbound-resourceadapter> tag in the Connector property file.

(2) Specifying optional name of DB Connector

With the database session failover functionality, you must specify an optional name for DB Connector. By default COSMINEXUS_SFO_DBCONNECTOR is specified as the optional name for DB Connector.

If you want to change the name to be specified from the default name, specify any name in the <optional-name> tag under the <hitachi-connector-property>-<resourceadapter>-<outbound-resourceadapter>-<connection-definition>-<connector-runtime>-<resource-external-property> tag in Connector property file. For details on specifying optional name of DB Connector, see 2.6 Assigning optional name to Enterprise Bean or J2EE server (user-specified name space functionality) in the uCosminexus Application Server Common Container Functionality Guide.

You must also change the optional name of DB Connector to be defined in a J2EE server to the same value. For details on specifying the optional name of DB Connector for J2EE servers, see 6.6.1 J2EE server settings.

(3) Environment settings of DB Connector

The database session failover functionality is used for implementing 24-hour continuous operation. In order to ensure that there is no impact on the system even if a failure occurs in a database, you must perform settings such as connection failure detection for implementing continuous operation. Consider the time required for recovery and set the value.

For details on connection failure detection, see 3.15.1 Detecting a connection failure in the uCosminexus Application Server Common Container Functionality Guide.

For details on properties to be set in DB Connector and setting methods, see 4.2.2 Defining the DB Connector properties in the uCosminexus Application Server Application Setup Guide.

This subsection describes the properties required to be set in a DB Connector.

(a) Properties to be set in <config-property> tag

This subsection describes the properties set in the <config-property> tag for each database used. Settings of the database session failover functionality are not required for the properties that are not described in this section.

Important note

If you want to use the database session failover functionality, you must set statement pooling. Statement pooling greatly affects memory usage of J2EE servers. Therefore, consider the connection pooling settings also and determine the value to be specified in the PreparedStatementPoolSize property.

For details on statement pooling, see 3.14.4 Statement pooling in the uCosminexus Application Server Common Container Functionality Guide. For details on connection pooling, see 3.14.1 Connection pooling in the uCosminexus Application Server Common Container Functionality Guide. For details on the values that you can specify in PreparedStatementPoolSize, see 4.1.10 Properties that you can specify in the <config-property> tag set up for DB Connector in the uCosminexus Application Server Application and Resource Definition Reference Guide. For details on memory size to be used per statement, see JDBC related documents.

Properties to be set when using HiRDB

The following table describes properties to be set when using HiRDB.

Table 6‒47: Properties to be set when using HiRDB

Value to be specified in the <config-property-name> tag

Value to be specified in the <config-property-type> tag

Contents or value to be specified in the <config-property-value> tag

Mandatory/Optional

description

java.lang.String

Specify connection addition information required for connecting to a database.

Mandatory

DBHostName

java.lang.String

Specify host name of HiRDB to be connected.

Mandatory

loginTimeout

java.lang.Integer

Specify maximum waiting time (seconds) for establishing physical connection with HiRDB server when acquiring Connection objects by using the getConnection method.

Optional

LONGVARBINARY_Access

java.lang.String

Specify LOCATOR.

Mandatory

PreparedStatementPoolSize

java.lang.Integer

Specify the numeric value determined by 30 × number-of-Web-applications -on-a-J2EE-server-that-use -the-database-session-failover -functionality.

Mandatory

CancelStatement

java.lang.Boolean

Specify true.

Mandatory

logLevel

java.lang.String

Specify any level for the levels of log trace output by DB Connector.

Optional

Legend:

Mandatory: Must be specified

Optional: Specify if required

Important note

To use the database session failover functionality, specify the following values in the client environment definition:

Environment variable name

Value

PDISLLVL

2

PDFORUPDATEEXLOCK

NO

PDDBLOG

ALL

Properties to be set when using Oracle

The following table describes properties to be set when using Oracle.

Table 6‒48: Properties to be set when using Oracle

Value to be specified in the <config-property-name> tag

Value to be specified in the <config-property-type> tag

Contents or value to be specified in the <config-property-value> tag

Mandatory/Optional

databaseName

java.lang.String

Specify a specific database name (SID) on Oracle server.

Mandatory#

serverName

java.lang.String

Specify host name or IP address of Oracle server.

Mandatory#

portNumber

java.lang.Integer

Specify a port number that listens to requests from Oracle server.

Mandatory#

url

java.lang.String

Specify JDBC URL required by Oracle JDBC Thin Driver for connecting to a database.

Mandatory#

loginTimeout

java.lang.Integer

Specify a timeout (units seconds) for connection trial to database.

Optional

PreparedStatementPoolSize

java.lang.Integer

Specify the numeric value determined by 30 × <number of Web applications on a J2EE server that uses the database session failover functionality>.

Mandatory

logLevel

java.lang.String

Specify any level for the levels of log trace output by DB Connector.

Optional

Legend:

Mandatory: Must be specified

Optional: Specify if required

#

Specify all values of databaseName, serverName, and portNumber, or specify the value of url.

(b) Properties to be specified in <property> tag

The following table describes the properties to be set in the <property> tag. Settings of the database session failover functionality are not required for the properties that are not described in this section.

Table 6‒49: Properties to be specified in the <property> tag

Value to be specified in the <property-name> tag

Value to be specified in the <property-type> tag

Value of the <property-default-value> tag

Contents or value to be specified in the <property-value> tag

Mandatory/Optional

MaxPoolSize

int

10

Specify maximum value of connection pool#1.

Mandatory

MinPoolSize

int

10

Specify minimum value of connection pool#1.

Mandatory

LogEnabled

boolean

true

Specify true.

Mandatory

User#2

String

--

Specify a user name.

Mandatory

Password

String

--

Specify a password.

Mandatory

ValidationType

int

1

Specify 1.

Mandatory

RetryCount

int

0

Specify connection acquisition retry count.

Specify a value, in accordance with the database settings and network environment that enables recovery of a database when a failure occurs.

Optional

RetryInterval

int

10

Specify connection acquisition retry interval.

Specify a value, in accordance with the database settings and network environment that enables recovery of a database when a failure occurs.

Optional

RequestQueueEnable

boolean

true

Specify true.

Mandatory#3

RequestQueueTimeout

int

30

Specify maximum value that can stop the queue waiting for connection acquisition when connections exhaust.#4

Mandatory#3

WatchEnabled

boolean

true

Specify whether you want to enable connection pool monitoring.

Optional

WatchInterval

int

30

Specify connection pool monitoring interval.

Optional

WatchThreshold

int

80

Specify threshold value that monitors connection pool use status.

Optional

WatchWriteFileEnabled

boolean

true

Specify true.

Optional

Legend:

Mandatory: Must be specified

Optional: Specify if required

--: None

#1

Calculate the value of the connection pool by using the formulas given below. Set the same value as the maximum and minimum value of the connection pool.

If you set number of concurrent execution threads in Web application unit or URL unit:

Sum of number of concurrent execution threads in a Web application that uses the database session failover functionality on a J2EE server + 2

If you set number of concurrent execution threads in J2EE server unit,

Number of concurrent execution threads in J2EE server + 2

If a J2EE server receives requests exceeding the maximum value of connection pools, those requests go to the state of waiting in a queue for acquiring connection, when connections exhaust.

#2

Register the creator of the table in the user set in DB Connector.

#3

These settings are not required if the functionality that controls the number of concurrent execution threads in the Web application unit, is disabled.

#4

Specify a value in the following range.

If Web server integration is used:

1 < RequestQueueTimeout < Timeout value for data reception from the web container that is set in the reverse proxy

In the preceding expression, Timeout value for data reception from the web container that is set in the reverse proxy is the value specified for the timeout key in the ProxyPass directive or the value specified in the Timeout directive.

If requests are directly exchanged with the J2EE server and not via a web server:

1 < RequestQueueTimeout