Hitachi

Hitachi Advanced Database Application Development Guide


19.2.4 a_rdb_SQLDisconnect() (close a connection)

Organization of this subsection

(1) Function

This CLI function closes a connection by terminating the current transaction normally, setting a synchronization point, and generating a commitment unit. The function then disconnects the application program from the HADB server.

(2) Format

signed short a_rdb_SQLDisconnect
(
  void                          *ConnectionHandle,   /* In */
  void                          *Option              /* In */
)

(3) Arguments

ConnectionHandle

Specifies a connection handle.

Option

Specifies NULL.

(4) Return value

  1. If a_rdb_SQLDisconnect() terminates normally, a_rdb_RC_SQL_SUCCESS is returned.

  2. If the connection was closed successfully, but the disk containing server message log files or client message log files has become full, a_rdb_RC_SQL_WARNING is returned.

  3. If an error occurs while messages cannot be output to the client message log file, the error cause code is returned. For details about the error cause code, see 19.8 Return values of the CLI functions.

(5) Notes

  1. If the transaction has not terminated when a_rdb_SQLDisconnect() is executed, the HADB server automatically executes COMMIT, and then the connection with the HADB server is closed.

  2. If an internally executed COMMIT has failed, the HADB server executes ROLLBACK and cancels the transaction, and then the connection with the HADB server is closed.

  3. If the application program terminates without a_rdb_SQLDisconnect() being executed, the HADB server executes ROLLBACK, and then the connection with the HADB server is closed.

  4. a_rdb_SQLDisconnect() cannot be executed if a connection has not been established.