3.6.5 Preconditions and notes on connecting to HiRDB
(1) Preconditions for HiRDB Version 8
The preconditions for HiRDB Version 8 are as follows:
(2) Preconditions for HiRDB Version 9
The preconditions for HiRDB Version 9 are as follows:
(3) Notes on connecting to HiRDB
Note the following when you connect to HiRDB:
- If you use the HiRDB auto-reconnect functionality, the connection is automatically re-established when the HiRDB server is disconnected due to an error such as the database network error. However, if the connection is lost during a transaction, the SQLException exception occurs. When the J2EE application receives the SQLException exception, do not continue the processing. If you continue to access DBMS, problems such as data inconsistency might occur.
- If you enable the connection pooling functionality and statement pooling functionality and use Statement.cancel(), the SQLException exception might occur. In this case, we recommend that you disable either the connection pooling functionality or statement pooling functionality.
- If the J2EE applications satisfy all the following conditions, two connections are used, which is double the number of users using the HiRDB connections concurrently. Specify a value that is twice the number of users using the HiRDB connections concurrently in the pd_max_users operand of the HiRDB common system definitions. For details on the pd_max_users operand, see the manual HiRDB Version 9 System Definition.
- DB Connector is used with the transaction support level XATransaction.
- The database is accessed by using the connection# in the Application Server-managed transactions.
- Before the transaction in point 2 concludes, the database is accessed by using the connection# outside the transaction.
#: This connection is the same connection as the one obtained from DB Connector in point 1.
- An error occurs when the J2EE applications satisfy all the following conditions:
- DB Connector is used with the transaction support level XATransaction.
- The database is accessed by using the connection# in the Application Server-managed transactions.
- Before the transaction in point 2 concludes, the database is accessed by using the connection# outside the transaction.
#: This connection is the same connection as the one obtained from DB Connector in point 1.
- If all the following conditions are satisfied, the same connection cannot participate in multiple different global transactions concurrently. Use a different connection for each transaction.
- DB Connector is used with the transaction support level XATransaction.
- The database is accessed by using the connection# in the Application Server-managed transactions.
- Before the transaction in point 2 concludes, the database is accessed by using the connection# outside the transaction.
#: This connection is the same connection as the one obtained from DB Connector in point 1.
- If you enable the HiRDB auto-reconnect functionality and statement pooling functionality, the SQLException exception containing message KFPA11901-E might occur during the execution of the SQL statement after the auto-reconnect functionality re-establishes the connection. When you connect to HiRDB using DB Connector with the transaction support level LocalTransaction or NoTransaction and enable the statement pooling functionality, do not use the HiRDB auto-reconnect functionality. When an error occurs, execute the connection error detection functionality or the cjclearpool command.