SQL/MX Connectivity Service Manual for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
For information on the ODBC/MX driver support for MFC, see the HP NonStop ODBC/MX Driver
for Windows for SQL/MX Release 3.2.1.
Design of MFC
MFC shares static module files created from dynamic queries using SQL/MX tools, across MXOSRVR
or SQL/MX connections.
MFC uses disk files on the NonStop Open System Services file system for storing the compiled
SQL/MX prepared statement plans. When the application uses prepareexecute or execdirect API,
MFC checks for an existing plan that matches the query. If a plan exists, it is loaded from the disk
thereby eliminating the requirement of SQL compilation of the query.
If a plan for an incoming PREPARE statement for a query is not found on the disk, a plan is created
as follows:
1. The incoming query is compiled as any other SQL/MX prepared statement.
2. After successful completion of the SQL/MX prepared statement, a plan is generated and stored
in the directory specified in the compiled_module_location attribute of SQL/MX.
Synchronization issues are handled using temporary lock files.
Use an MFC management script for maintaining the compiled module plans on the NonStop server.
The MFC management script is described under “Managing MFC” (page 51).
In releases prior to SQL/MX Release 3.2.1, the MXOSRVR waits until the SQL query compilation
generates the MFC file, thus blocking the client. Starting with SQL/MX Release 3.2.1, this limitation
is overcome by running the MFC file generation process in the background. As a result of this
optimization, MFC module files may fail to generate for few SQL queries if any DDL query such
as DROP or ALTER is executed immediately after compilation of the SQL query.
Configuring MFC from the MXCS mode
To configure the module file caching feature using the MXCS subsystem:
1. Enter the MXCS subsystem through MXCI:
mode mxcs;
2. Configure a data source for the user-specified MXOAS service:
add ds $MXOAS.”MCBS_datasource”;
NOTE: For instructions on adding a data source, see the SQL/MX Connectivity Service
Administrative Command Reference manual.
3. Stop the data source:
stop ds “MCBS_datasource”, reason ‘test’;
NOTE: Perform step 3 only if the configured data source is in the started state.
4. Add the statement_module_caching attribute to the data source to enable the module
file caching feature:
add evar $MXOAS.”MCBS_datasource”.statement_module_caching, type
set, value ‘true’;
This attribute has only two values, true and false. By default, this attribute is not enabled.
5. Add the compiled_module_location attribute to the data source:
add evar $MXOAS.”MCBS_datasource”.compiled_module_location, type
set, value ‘default’;
add evar $MXOAS.”MCBS_datasource”.compiled_module_location, type
set, value ‘/usr/MCBS_modules’;
Module File Caching (MFC) 49










