uCosminexus Service Platform, Overview

[Contents][Glossary][Index][Back][Next]

2.6.4 Dynamic change in connection destination information for DB adapters

You can dynamically change the DB adapter connection destination by setting a resource alias for the connection destination DB Connector in the DB adapter. If the resource alias for the connection destination DB Connector has been set in advance in the business process, the connection destination changes when the DB adapter is executed. This can reduce the number of DB adapters to be created.

Organization of this subsection
(1) Procedure for dynamically changing the connection destination
(2) Preconditions for dynamically changing the connection destination
(3) Example of dynamic change of connection destination information
(4) Example of WSDL creation generating user-defined reception

(1) Procedure for dynamically changing the connection destination

The following describes the procedure for dynamically changing the DB adapter connection destination.

  1. Acquire connection destination information from the header message in the request message.
  2. Establish a connection with the database based on the acquired information.

If an attempt to acquire the connection destination information fails because, for example, the connection destination is not set in the header message, a request process causes an error.

(2) Preconditions for dynamically changing the connection destination

The following describes the preconditions for dynamically changing the connection destination of the DB adapter.

(a) Assigning a resource alias

Assign a resource alias to the connection destination DB Connector.

For details about the rules for assigning aliases, see 2.6.2 Rules for assigning the optional names in the Application Server Common Container Functionality Guide.

(b) Setting up the SQL operation definition file

Set the dynamic attribute to Y in the SQL operation definition file.

(c) Selecting the DB Connector type

Make sure that the connection destination DB Connector type is the same as the database type specified in the SQL operation definition file.

(d) Specifying the transaction support level

You can specify LocalTransaction or XATransaction as the transaction support level of the connection destination DB Connector.

The following table shows the specifiable transaction support levels and required conditions.

Table 2-6 Specifiable transaction support levels and required conditions

Specifiable transaction support level Required conditions
LocalTransaction or XATransaction
  • The status is not made persistent in the business process.
  • The transaction of the DB adapter starts separately from the business process.
  • The status is made persistent in the business process, and the transaction of the DB adapter starts separately from the business process.
XATransaction Any condition other than the above.
(e) Setting up a business process

Specify the connection destination information in a business process.

(3) Example of dynamic change of connection destination information

The following describes an example of dynamically changing connection destination information by using the connection destination information file.

(a) Example of a business process

The following figure shows an example of a business process using the connection destination information file.

Figure 2-49 Example of a business process using the connection destination information file (in a DB adapter)

[Figure]

  1. The service requester requests execution of a service component in the business process.
  2. Set the connection destination information (resource alias for the DB Connector) in the header message in the request message sent from the service requester.
  3. The business process receives an XML request message by the receive activity.
  4. The business process generates header request data and request data.
  5. Set the connection destination information of the header request data in the connection destination information variables by using a data transformation activity.
  6. The business process sets the connection destination information contained in the connection destination information variables to the DB adapter, and then invokes the service component.
  7. The business process configures the service component execution result as an XML response message, and then returns it by using a reply activity.
  8. A response is returned to the service requester.
  9. An XML response message is sent in response to the service requester.

(4) Example of WSDL creation generating user-defined reception

The figure below shows an example of creating a WSDL that generates user-defined reception.

In this example, the resource alias for the DB Connector to be connected is sent in the SOAP header.

[Figure]

(a) Example of setting data transformation activities

The figure below shows an example of setting data transformation activities used in the business process shown in Figure 2-49 Example of a business process using the connection destination information file (in a DB adapter).

Here, Header request data is specified in the transformation source and Connection destination is specified in the transformation destination.

Figure 2-50 Example of setting data transformation activities (in a DB adapter)

[Figure]

The following figure shows the definition of transformation mapping.

Figure 2-51 Example of setting transformation mapping (in a DB adapter)

[Figure]

(b) Defining a connection destination information file

Define the resource alias of the DB Connector in the connection destination information file (XML schema) used for setting up a DB adapter.

The connection destination information file is provided in Service Platform.

(c) Setting connection destination information

The following figure shows an example of setting connection destination information used in the business process shown in Figure 2-49 Example of business process using connection destination information file (in a DB adapter). Set connection destination information in the header assigned variable of the invoke service activity. The information set here can be viewed in the DB adapter.

Figure 2-52 Example of setting connection destination information (setting invoke service activity)

[Figure]