This subsection describes the features of connections using DB Connector for Cosminexus RM and Cosminexus RM.
By using DB Connector for Cosminexus RM to integrate with Cosminexus RM, you can send and receive messages using the JMS interface for the database queue, and invoke the Message-driven Beans started by the messages.
When you connect to a database using DB Connector for Cosminexus RM and Cosminexus RM, the following can be realized because the JMS interface and JDBC interface share the physical connection used for access and the processing performance is improved:
The following figure gives an overview of DB Connector for Cosminexus RM and Cosminexus RM processing when the JMS interface and JDBC interface are used to access the database from servlets, JSPs, or Enterprise Beans.
Figure 3-21 Overview of the processing for DB Connector for Cosminexus RM and Cosminexus RM
The database is accessed via Cosminexus RM using the JMS interface, and the database is accessed via DB Connector for Cosminexus RM using the JDBC interface. Note that to set up a queue on the database, the JDBC interface-based database access is used internally with Cosminexus RM. Therefore, the database is accessed via the JDBC driver.
Furthermore, with DB Connector for Cosminexus RM, the database is accessed via Cosminexus RM, by sharing the physical connection with Cosminexus RM. These resource adapters use the connection pool for Cosminexus RM to obtain the connections. As a result, the sharing of the physical connections is realized.
This subsection describes the resource configuration pattern when DB Connector for Cosminexus RM and Cosminexus RM are used for connection. The resource configurations for the following cases will be described here:
Note that the connections can be shared when the same database is accessed with the JMS interface and JDBC interface and when the Message-driven Beans are used. However, to share a connection, the following preconditions must be satisfied:
When the database queue alone is accessed with the user program, use the configuration shown in the following figure.
Figure 3-22 Configuration when the JMS interface is used alone
When the JMS interface and JDBC interface are used to access the database with the user program, the same database can be accessed by two types of interfaces if the preconditions for connection sharing are satisfied. At this time, use the configuration shown in the following figure.
By using this configuration, you can improve the processing performance of the transactions through connection sharing and utilize the resources effectively.
Figure 3-23 Configuration when the same database is accessed with the JMS interface and JDBC interface
When the JMS interface and JDBC interface are used to access the database with the user program, you must use a configuration in which different databases will be accessed for each interface if the preconditions for connection sharing are not satisfied. At this time, use the configuration shown in the following figure.
Figure 3-24 Configuration when different databases are accessed with the JMS interface and JDBC interface
Use DB Connector for Cosminexus RM and Cosminexus RM to access the database queue. Also, to access the database tables, you must prepare and use DB Connector separately.
When the Message-driven Beans are used, use the configuration show in the following figure. If the connection sharing conditions are satisfied, you can use the JDBC interface of DB Connector for Cosminexus RM and share the connection between the Message-driven Beans and the JDBC interface.
Note that when the Message-driven Beans are used, you can use the global transactions and local transactions when the associated resource adapter is Cosminexus RM 01-01 or later. When you use the Cosminexus RM 01-00 resource adapter, you must use a global transaction. At this time, you cannot use a local transaction, but if the preconditions for connection sharing are satisfied, a global transaction is concluded through a single phase.
Figure 3-25 Configuration when the Message-driven Beans are used