Client connection
For a client application, a connection is the mechanism that the application uses to request a synchronization with the database server for the purpose of exchanging data.
A client application (such as IBM®
Informix® ESQL/C or
client LIBMI applications) takes the following steps to request a connection:
- Initializes the connection.
A client LIBMI application can set connection, database, and session parameters to determine attributes of the connection.
- Establishes the connection.The Informix ESQL/C client application uses SQL statements (such as CONNECT or DATABASE) to establish a connection. A client LIBMI application uses the DataBlade API to establish a connection in either of the following ways:
- Uses the mi_open() function
- Uses the mi_server_connect() function
When a client application connects to the database server, the
database server performs the following tasks:
- Creates a session structure, called a session control block, to hold information about the connection and the user.
- Creates a thread structure, called a thread-control block (TCB), to hold information about the current state of the thread.
- Determines the server-processing locale, the locale to use for SQL statements during the session.
- Initializes a primary thread, called the session thread (or sqlexec thread), to handle client-application requests.
When the client application successfully establishes a connection, it begins a session. Only a client application can begin a session. The session context consists of data structures and state information that are associated with a specific session, such as cursors, save sets, and user data.