If the connection is broken, terminate the running UAP and then restart it. Connection should be re-established automatically.
If restarting the application program is not desired, tx_open must be reissued when the error indicating the broken connection is returned to the application program. The service can be resumed without having to terminate the application program. Following is an example of coding for reissuing tx_open.
int connection = 1; |
If you are using an XA interface supporting multi-thread, connection with HiRDB is established when a transaction is started, and connection is cut off when the transaction is terminated. Therefore, even if the connection is broken during communication, it will be re-established when the next transaction is started.
If you used dynamic registration, specify transaction in the trn_rm_open_close_scope operand in OpenTP1's transaction service definition or user service definition, so that OpenTP1 establishes connection with HiRDB when a transaction is started and disconnects from HiRDB when the transaction is terminated. Therefore, even if the connection is broken during communication, it will be re-established when the next transaction is started.
If you used static registration, the transaction manager checks the connection with HiRDB when a transaction is started. If the connection has been broken, it is re-established automatically, and the transaction is started.
If connection with HiRDB is broken before the first SQL statement for accessing HiRDB is executed since the transaction manager started the transaction, the HiRDB client library re-establishes connection when the SQL statement is executed.