Hitachi

Hitachi Advanced Database Application Development Guide


19.1.2 Common rules

This subsection describes the rules common to all CLI functions.

Organization of this subsection

(1) Connection handle

A connection handle is used to uniquely identify each connection to the HADB server. A connection handle must remain valid from the time the connection to the HADB server is established until the connection is closed. If the connection handle does not remain valid for this entire period, operation is not guaranteed. To keep a connection handle valid, you must specify the connection handle allocated by a_rdb_SQLAllocConnect() in the argument of every CLI function until the connection handle is released by a_rdb_SQLFreeConnect().

(2) SQL results information

You can acquire various types of SQL results information for each CLI function call. If you wish to acquire SQL results information, you must not release the area that stores the SQL results information until the connection to the HADB server is closed.

(3) Statement handle

A statement handle is used to provide a unique identification for each allocated SQL statement. When COMMIT or ROLLBACK occurs, the statement handle is released.

If you attempt to use multiple statement handles allocated by the same connection handle to execute SQL statements concurrently, but the number of processing real threads available does not match the maximum number of SQL processing real threads, SQL statement execution requests will result in an error (the requests will not be placed in wait status).

The maximum number of SQL processing real threads is specified in the following operands:

(4) Implicit cursor

Typically, table retrieval results consist of multiple rows. In order for an application program to retrieve one row of retrieval results at a time, a pointer called a cursor is used to retain the most recent retrieval location. The cursor is used for data retrieval.

A cursor is allocated when a SELECT statement is preprocessed and is opened when the SELECT statement is executed. When COMMIT or ROLLBACK occurs, all open cursors are closed.