20.3.3 Setting the DB Connector for a root resource adapter
Set up the DB Connector for the root resource adapter with the following procedure:
-
Import the DB Connector for the root resource adapter.
-
Define the properties.
-
Deploy the DB Connector for the root resource adapter.
-
Check the connectivity.
- Organization of this subsection
(1) Importing the DB Connector for a root resource adapter
Execute the following command to import the DB Connector for the root resource adapter:
(a) Execution format
cjimportres [server-name] [-nameserver provider-URL] -type rar -f file-path
Specify the RAR file in file-path.
The RAR file is stored in the following directory:
-
In Windows
Cosminexus-installation-directory\CC\DBConnector\ClusterPool\
-
In UNIX
/opt/Cosminexus/CC/DBConnector/ClusterPool/
The RAR files to be imported as root resource adapters are explained below:
- DBConnector_CP_ClusterPool_Root.rar
-
DBConnector_CP_ClusterPool_Root.rar is a root resource adapter of a cluster connection pool. Use this RAR file when a member resource adapter that belongs to the root resource adapter uses a local transaction or no transaction (when LocalTransaction or NoTransaction is specified in the transaction support level) for connecting to the database.
Specify the RAR file in the resource reference of the J2EE applications.
(b) Example of execution
cjimportres MyServer -type rar -f "c:\Program Files\Hitachi\Cosminexus\CC\DBConnector\ClusterPool\DBConnector_CP_ClusterPool_Root.rar"
For details on the cjimportres command, see cjimportres (import resource) in the uCosminexus Application Server Command Reference Guide.
(2) Defining DB Connector properties for a root resource adapter
You define the properties of the DB Connector for the root resource adapter. For details on the procedure for defining the properties, see 4.2.2 Defining the DB Connector properties in the manual uCosminexus Application Server Application Setup Guide. This section explains the settings for the properties of a DB Connector for the root resource adapter.
The valid properties for the DB Connector for the root resource adapter are described below. The items other than those described below are ignored even if specified.
-
Description of the DB Connector for the root resource adapter (<description>)
-
Name of the DB Connector for the root resource adapter (<display-name>)
-
Configuration properties (<outbound-resourceadapter> - <connection-definition> - <config-property>)
-
Choosing whether to output the log of runtime properties (<outbound-resourceadapter> - <connection-definition> - <connector-runtime>) (<LogEnabled>)
-
Optional name information (<outbound-resourceadapter> - <connection-definition> - <connector-runtime> - <resource-external-property>)
The following table describes the settings for configuration properties:
|
Items |
Corresponding tags |
|---|---|
|
Configuration property name |
<config-property-name> |
|
Configuration property data type |
<config-property-type> |
|
Configuration property value |
<config-property-value> |
Repeat the above settings for all the configuration properties that you want to define.
The following table describes the settings and an example of configuration property settings when using DBConnector_CP_ClusterPool_Root.rar:
|
Item names |
Example of settings |
|---|---|
|
Algorithm |
RoundRobin |
|
enableAutoPoolSuspend |
True |
|
enableAutoPoolResume |
True |
|
dbCheckInterval |
30 |
|
memberResourceAdapterName1 |
DB_Connector_for_Oracle_ClusterPool_Member1 |
|
memberResourceAdapterName2 |
DB_Connector_for_Oracle_ClusterPool_Member2 |
|
logLevel |
ERROR |
Set up the display name of the member resource adapter for the memberResourceAdapterName[n] property of configuration property name (<config-property-name>). By default, memberResourceAdapterName[n] is defined up to priority 2. When you specify a member resource adapter, add the properties. Specify priority n in the range of 1 to 100. n need not be consecutive.
(3) Deploying the DB Connector for a root resource adapter
If you deploy the DB Connector for the root resource adapter, you can use it as a J2EE resource adapter. Note that you can define the properties after deploying the DB Connector. In such a case, however, define the properties when the applicable DB Connector for the root resource adapter is not running. For details on how to define the properties, see (2) Defining DB Connector properties for a root resource adapter.
Execute the following command to deploy the DB Connector for the root resource adapter:
- Execution format
cjdeployrar [server-name] [-nameserver provider-URL] -resname Display-name-of-DB-Connector-for-the-root-resource-adapter
- Example of execution
cjdeployrar MyServer -resname DB_Connector_for_ClusterPool_Root
For details on the cjdeployrar command, see cjdeployrar (deploy resource adapter) in the uCosminexus Application Server Command Reference Guide.
(4) Testing the connectivity of DB Connector for root resource adapter
Use the connectivity test to verify whether the information set in the DB Connector for the root resource adapter is correct.
Execute the following command to perform the connectivity testing of the DB Connector for the root resource adapter:
- Execution format
cjtestres [server-name] [-nameserver provider-URL] -type rar -resname Display-name-of-DB-Connector-for-the-root-resource-adapter
- Example of execution
cjtestres -type rar -resname DB_Connector_for_ClusterPool_Root
For details on the cjtestres command, see cjtestres (execute resource connection test) in the uCosminexus Application Server Command Reference Guide.
- Note:
-
You cannot delete the DB Connector for the root resource adapter whose connection is once tested until you restart the J2EE server. To delete the DB Connector for the root resource adapter, stop the DB Connector for the root resource adapter and then restart the J2EE server.