Scalable Database Server, HiRDB Version 8 UAP Development Guide

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

4.16.2 Reconnect timings

Reconnection is performed at the following times:

Organization of this subsection
(1) If the HiRDB client executes an SQL statement immediately after executing the CONNECT statement, or when the transaction for the previous SQL statement is completed
(2) When the HiRDB client executes an SQL statement while the HiRDB server is processing the transaction for the previous SQL statement
(3) When the HiRDB client executes the CONNECT statement

(1) If the HiRDB client executes an SQL statement immediately after executing the CONNECT statement, or when the transaction for the previous SQL statement is completed

When the HiRDB client executes an SQL statement, the automatic reconnect facility detects whether the connection with the HiRDB server has been disconnected. If the facility detects a disconnection, it reconnects the client to the server, and re-executes the SQL statement after the connection is re-established. If the automatic reconnect facility detects a connection failure when the HiRDB client executes an SQL statement after automatic reconnection, it returns an error to the UAP. Figure 4-66 shows the reconnect timing (when the HiRDB client executes an SQL statement immediately after executing the CONNECT statement, or when the transaction for the previous SQL statement is completed).

Figure 4-66 Reconnect timing (when the HiRDB client executes an SQL statement immediately after executing the CONNECT statement, or when the transaction for the previous SQL statement is completed)

[Figure]

(2) When the HiRDB client executes an SQL statement while the HiRDB server is processing the transaction for the previous SQL statement

When the HiRDB client executes an SQL statement, the automatic reconnect facility detects whether the connection with the HiRDB server has been disconnected. If the facility detects a disconnection, it returns a connection error (SQLCODE = -722 or -723) to the UAP. When the client executes the next SQL statement, the facility reconnects with the server and re-executes the previous SQL statement.

If the automatic reconnect facility detects a connection failure when the HiRDB client executes an SQL statement after automatic reconnection, it returns an error to the UAP. Figure 4-67 shows the reconnect timing (when the HiRDB client executes an SQL statement while the HiRDB server is processing the transaction for the previous SQL statement). Any uncompleted transactions that were being executed when the SQL statement with the returned error was executed are rolled back.

Figure 4-67 Reconnect timing (when the HiRDB client executes an SQL statement while the HiRDB server is processing the transaction for the previous SQL statement)

[Figure]

(3) When the HiRDB client executes the CONNECT statement

If the HiRDB client executes the CONNECT statement and the connection fails because of a communication error, the automatic reconnect facility executes reconnect processing.

Figure 4-68 shows the reconnect timing (when the HiRDB client executes the CONNECT statement).

Figure 4-68 Reconnect timing (when the HiRDB client executes the CONNECT statement)

[Figure]