You can control ODBC handle validation with the client-side Client.ODBCHandleValidation parameter, see Client section, or dynamically with the non-standard ODBC attribute SQL_ATTR_HANDLE_VALIDATION. For performance reasons, ODBC handle validation in solidDB is switched off by default.
For example, in Windows environments with the ODBC driver manager, the driver manager performs the handle validation and the solidDB ODBC driver does not need to repeat the same validation procedures. Also, a carefully written ODBC application does not normally cause invalid handles to be used; in such a case, the handle validation in the ODBC driver is not needed. In both cases, the applications can benefit from performance improvements when skipping the handle validation in the driver.
To switch ODBC handle validation on, do one of the following steps:
▪ In the client-side solid.ini file, set Client.ODBCHandleValidation to yes.
▪ Set the non-standard environment attribute SQL_ATTR_HANDLE_VALIDATION to 1 (on):
Important The SQL_ATTR_HANDLE_VALIDATION attribute must be set after creating the environment handle but before any other handle is created. The SQL_ATTR_HANDLE_VALIDATION attribute is global; when set, it affects all the solidDB ODBC handles initiated by the application. This ensures consistency by preventing the application from allocating both validated and non-validated handles.
When the handle validation is switched on, any ODBC function can fail with the standard return value SQL_INVALID_HANDLE.
If handle validation is turned off and invalid handle is used by the application, the ODBC driver behavior is unpredictable and most likely causes the application to crash.