Home | Previous Page | Next Page   Database Access > Handling Connections > Initializing a Client Connection >

Using Session Parameters

The parameter-information descriptor, MI_PARAMETER_INFO, allows you to set the following session parameters for the client LIBMI application:

Unlike most DataBlade API structures, the parameter-information descriptor is not an opaque C data structure. To access session-parameter information, you must directly access the fields of a parameter-information descriptor that you allocate. Table 49 shows the fields in the MI_PARAMETER_INFO structure.

Table 49. Fields in the Parameter-Information Descriptor
Field Data Type Description
callbacks_enabled mi_integer Indicates whether callbacks are enabled:
  • A value of 1 indicates that callbacks are enabled.
  • A value of 0 indicates that callbacks are disabled.
pointer_checks_enabled mi_integer Indicates whether pointers (such as MI_ROW pointers) that the client LIBMI application passes to the database server are checked to ensure that they are within the heap space of the process:
  • A value of 1 indicates that pointers are checked.
  • A value of 0 indicates that pointers are not checked.

The milib.h header file defines the MI_PARAMETER_INFO structure.

Before you establish a connection, you can determine which of the following session parameters to use:

Using System-Default Session Parameters

When the database server establishes a connection, it uses the values in Table 50 as the system-default session parameters.

Table 50. System-Default Session Parameters
System-Default Session Parameter System-Default Value
Callbacks Enabled? Yes
Pointers Checked? Yes

The system-default session parameters provide session-parameter information for all connections made within a client LIBMI application unless you explicitly override them within the application.

Using User-Defined Session Parameters

The database server obtains values for the session parameters from the parameter-information descriptor. The database server initializes the parameter-information descriptor with the system-default session parameters in page Table 50. To override these system-default values, you can initialize your own parameter-information descriptor to set session parameters.

The following DataBlade API functions access default session parameters for a client LIBMI application.

DataBlade API Function
Purpose
mi_set_parameter_info( )
Sets session parameters for the current session
mi_get_parameter_info( )
Obtains session parameters for the current session
To override the system-default session parameters
  1. Allocate a parameter-information descriptor.
  2. Fill the fields of the parameter-information descriptor with the default session parameters you need.

    If you do not set a particular field, the database server uses the system-default value in Table 50 for the associated session parameter.

  3. Pass a pointer to this parameter-information descriptor to the mi_set_parameter_info( ) function.

You can examine existing session parameters with the mi_get_parameter_info( ) function. This function populates a user-defined parameter-information descriptor with the current session parameters.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]