When executing a Data Driven Testcase the following error occurs: Maximum number of SQL handles has been exceeded. How can I alleviate this?
This behaviour is typical of a SilkTest script that is assigning handles for a testing session that are not being closed after they have been finished with.
Typical handles are applied to the following methods:
1. DB_Connect function: the returned handle to a database connection.
2. DB_ExecuteSql function: the returned handle to the executed SQL statement.
It is therefore very important to close whatever handle you have assigned once it has been finished with. Currently SilkTest has a capacity to deal with 1024 handles, therefore once this threshold has been breached the resulting error will occur.
"Maximum number of SQL handles has been exceeded"
An example of this would be
// Set Up Handles for SQL command and Database Connection HANDLE hDB = DB_Connect("DSN=Book1") // DB handle HANDLE hSQL // sql handle hSQL = DB_ExecuteSQL(hDB, "SELECT * FROM `Sheet1$``Sheet1$` WHERE `Sheet1$`.Name="John"") // Close these handles when finished with to reduce number of open handles. DB_FinishSql (hSQL) DB_Disconnect (hDB)