Configuration Settings
This section describes how to access and change configuration settings and tells you more about the array bind and array fetch modes. It is divided as follows:
Default Settings
Any
IldRequest object returned by the function
IldDbms::getFreeRequest is configured using the current configuration setting from its related
IldDbms object.
Thus, it inherits the array fetch size and the parameter array size, as well as the settings for the date as string, numeric as string, and numeric as object features.
Note: The error reporter is not reset when an IldRequest object has been released and is later reassigned by IldDbms::getFreeRequest. |
Accessing and Changing the Configuration
Table 4.1 shows what member functions of the class
IldRequest you can use to change the default configuration settings.
Changing the Default Configuration Settings
Use | To |
| Change the fetch array size |
| Return the cursor to the default fetching protocol (one row at a time) |
| Retrieve the current fetch array size |
| Set the parameter array size |
| Return the cursor to the default binding protocol (one parameter row at a time) |
| Retrieve the current parameter array size |
Array Modes
Rogue Wave DB Link can handle several rows at a time, whether input or output data. The default setting, however, is one row at a time.
Each
IldRequest object inherits the settings of its related
IldDbms object. The default settings can be changed at the
IldDbms level.
While using array modes enhances performance —at the network communication level for array fetch and with respect to CPU time for array bind—you must be aware that Rogue Wave DB Link pre-allocates memory for data values and null indicators. The data buffers are allocated the maximum size required for the column data types, except for the LOB types IldLongTextType and IldBinaryType, for which the buffer size is limited to 64 Kilobytes. Consequently, on some systems with limited memory, setting the array mode to a high number of rows may cause an allocation failure.
Array Bind Mode
To set the
array bind mode, specify the number of rows you want to send at a time. This number is a maximum and can be changed by the value of the second argument passed to the member function
IldRequest::execute.
For each
IldRequest object, you can change the array size using the function
IldRequest::setParamArraySize with a positive integer as its argument:
{
cout << "Host variables array size set to 2" << endl;
request->setParamArraySize(2);
}
Warning: To be effective, the array bind size must be set before the function parse or execute is called. |
Array Fetch Mode
Since the cursor-relative positioning and absolute positioning are not implemented, these features do not prevent you from using the function
IldRequest::fetch.
To set the default value for all newly created
IldRequest objects, use the function
IldDbms::setDefaultColArraySize with a positive integer as its argument.
{
dbms->setDefaultColArraySize((IlUInt)10);
}
Warning: To be effective, the array fetch size must be set before the first call to the fetch member function. |
With ODBC, the array fetch mode is available only if the driver has level-2 compliance.
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.