Product Documentation

c-treeACE V11.0 Release Notes

Previous Topic

Next Topic

BATSETX no Longer Fails on First Call with a Buffer too Small

Calls to BATSETX did not return expected results with a small buffer. In some cases an application that used a buffer too small to hold the first record to be returned would not have an error indication. Logic has been modified to correct this situation.

Note: It is not unusual for a buffer to be too small to hold all the records being requested by the batch. However, when the first record does not fit, no record will be returned and no progress will be made on the batch request. Another call to BATSETX will need to be made with a larger buffer.

In V11 and later, a new mechanism has been provided to return the buffer size required to avoid the BTBZ_ERR. This new behavior only occurs if the BATSETX call that failed with BTBZ_ERR has BAT_BTBZ_ERR OR-ed into the BATSETX mode parameter. For example, the following BATSETX call would behave as usual if no BTBZ_ERR was returned, but the second LONG integer return value (request[1]) would have the minimum buffer size requirement for the subsequent BATSETX call to succeed (instead of bavail):

LONG request[5] = {0};

pVOID buffer[8192];

NINT rc;

rc = BATSETX(datno,request,buffer,8192,BAT_GET | BAT_PHYS |

BAT_RET_REC | BAT_BTBZ_ERR);

TOCIndex