3.3.8 Procedure for resource adapter settings (To deploy and use the resource adapter as a J2EE resource adapter)

This subsection describes the following procedure for deploying and using the resource adapter as a J2EE resource adapter:

Use the server management commands to set up resource adapters.

Organization of this subsection
(1) Procedure for setting up a new resource adapter
(2) Procedure for changing the resource adapter settings
(3) Procedure for replacing the resource adapters

(1) Procedure for setting up a new resource adapter

The following figure shows the procedure for setting up a new resource adapter when Application Server is connected to a database or another resource.

Figure 3-2 Procedure for setting up a new resource adapter

[Figure]

A description of points 1 to 4 in the figure is as follows:

  1. Use the server management commands to import the resource adapter.
    Use the cjimportres command to import the resource adapter.
    You import a different RAR file when DB Connector is used to connect to a database and when other resource adapters are used to connect to various resources such as OpenTP1. For details on the resource adapters to be imported, see 3.3.2 Types of resource adapters.
  2. Use the server management commands to deploy the resource adapter.
    Use the cjdeployrar command to deploy the resource adapter.
    If you deploy a resource adapter, you can use the resource adapter as a J2EE resource adapter. A J2EE resource adapter is a resource adapter that is deployed as a shared standalone module for the J2EE server. If you deploy a resource adapter that was imported with the server management commands, the resource adapter becomes available to all the J2EE applications running on the J2EE server.
  3. Use the server management commands to define resource adapter properties.
    Use the cjgetrarprop command to obtain the HITACHI Connector Property file, edit the file, and then use the cjsetrarprop command to apply the edited content.
    For details on the resource adapter properties specified for the functionality to be used, see the following locations:
  4. Use the server management commands to implement the resource adapter connection test.
    Use the cjtestres command to implement the resource adapter connection test. For details on the content to be verified in the connection test for each resource, see 3.18 Connection test for resources.
    Note
    The connection test for connecting to a database by using DB Connector for Cosminexus RM and Cosminexus RM involves the following order:
    1. Start DB Connector for Cosminexus RM.
    2. Implement the connection test for Cosminexus RM.
    3. Start Cosminexus RM.
    4. Implement the connection test for DB Connector for Cosminexus RM.
    For details on the connection test of the J2EE resource adapters used when DB Connector for Cosminexus RM is used, see 2.7 Functionality for DB Connector for Cosminexus RM in the manual uCosminexus Application Server Reliable Messaging.

For details on the operations with the server management commands, see 3. Basic Operations of the Server Management Commands in the uCosminexus Application Server Application Setup Guide. Also, for details on the commands, see 2.4 Resource operation commands used with the J2EE server in the uCosminexus Application Server Command Reference Guide. For details on the property files, see 4. Property Files Used for Setting Up the Resources in the uCosminexus Application Server Application and Resource Definition Reference Guide.

Note
To use a resource adapter, you must resolve the references from the J2EE application to the resource adapter. When you define the properties for a J2EE application that uses resource adapters, resolve the references from the J2EE application to the resource adapter.
Reference note
In the cases such as those described below, you can set up the resource adapter efficiently by exporting or importing the resource adapter:
  • When you export the resource adapter set up in the development environment, and then import the resource adapter into the operating environment
  • When you export the resource adapter that is already running in the operating environment, and then import the resource adapter into an extended J2EE server
Execute the export and import operations using cjexportrar and cjimportres.
Note that you cannot export or import resource adapters between hosts with different Application Server versions and platforms. To set up a resource adapter on the host that exports the resource adapter and the host with a different Application Server version and platform, set up a new resource adapter.

(2) Procedure for changing the resource adapter settings

This section describes the procedure for changing the settings for a deployed resource adapter. The following figure shows the procedure for changing the settings.

Figure 3-3 Procedure for changing the resource adapter settings

[Figure]

A description of points 1 and 2 in the figure is as follows:

  1. Use the server management commands to stop the resource adapter.
    Use the cjstoprar command to stop the resource adapter. Note that before you stop the resource adapter, make sure you stop all the J2EE applications that are using the resource adapter.
  2. Use the server management commands to define the resource adapter properties.
    The resource adapter is already deployed; therefore, use the cjgetrarprop command to obtain the property file, edit the file, and then use the cjsetrarprop command to apply the edited content.

(3) Procedure for replacing the resource adapters

This section describes the procedure for replacing the resource adapters. The following figure shows the procedure for replacing the resource adapters.

Figure 3-4 Procedure for replacing the resource adapters

[Figure]

A description of points 1 to 3 in the figure is as follows:

  1. Stop the J2EE server.
    Use the cjstopsv command to stop the J2EE server.
  2. Replace the resource adapter.
    Use the cjrarupdate command to replace the resource adapter.
  3. Start the J2EE server.
    Use the cjstartsv command to start the J2EE server.

You can also replace a resource adapter without using the cjrarupdate command. The following figure shows the procedure for replacing the resource adapters without using the cjrarupdate command.

Figure 3-5 Procedure for replacing the resource adapters (when the cjrarupdate command is not used)

[Figure]

A description of points 1 to 7 in the figure is as follows:

  1. Use the server management commands to stop the resource adapter.
    Use the cjstoprar command to stop the resource adapter you want to replace. Note that before you stop the resource adapter, make sure you stop all the J2EE applications that are using the resource adapter.
  2. Restart the J2EE server.
    Use the cjstopsv command to stop the J2EE server, and then use the cjstartsv command to start the J2EE server.
  3. Use the server management commands to save the resource adapter property definitions.
    To inherit the resource adapter property definitions, use the cjgetrarprop command or cjgetresprop command to obtain the HITACHI Connector Property file of the resource adapter.
  4. Use the server management commands to undeploy the resource adapter.
    Use the cjundeployrar command to undeploy the resource adapter you want to replace.
  5. Use the server management commands to delete the resource adapter.
    Use the cjdeleteres command to delete the resource adapter you want to replace.
  6. Use the server management commands to set up the resource adapter.
    Set up the resource adapter as described in (1) Procedure for setting up a new resource adapter. To inherit the resource adapter property definitions, use the HITACHI Connector Property file obtained in point 3.
  7. Use the server management commands to start the resource adapter.
    Use the cjstartrar command to start the resource adapter. Note that after you start the resource adapter, start the J2EE applications that use the resource adapter.