SmartObject Timeout Error
kbt133195
PRODUCTIssue
The error message shown below appears when executing a read method of a SQL Server Service Instance based SmartObject or when trying to register a new service instance via SmartObjects Services Tester tool.
Sample error message screenshot:
Error message text:
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Symptoms
When using mainly SmartObjects created from a SQL table or connected to a stored procedure, that take about 30 seconds to execute a "Select method" on SQL, then you might get a timeout error on the SmartObject tester. Additional notes: The SmartObject was created on K2 Studio, the client is connecting to the SmartObject via a stored procedure that connects to DB400 (on an IBM DB).Troubleshooting Steps
Complete these steps to resolve this issue:
- On the SmartObject tester tool right click and edit the SQL Service instance
- There is a commandtimeout value, increase that from 30 seconds to 60 or 90 seconds (exact value may be different for different environments):
In case you are facing this issue doing SmO call to SQL DB not through explicitly registered SQL Server Service Instance (e.g. Workflow Reporting Service) which connects to K2 DB through the SQL broker, you have to increase command timeout on the broker level. To do this follow these steps:
- Open K2HostServer.exe.config file which has the following default location for K2 Five: "C:Program Files (x86)K2Host ServerBin"
- Search for "commandtimeout" keyword - there should be 2 entries, and then edit the following line:
- Increase default value of commandtimeout="30" to "60" or "90" (always start from smaller value and increase only if necessary) and save changes in configuration file.
- Restart K2 service.
If you have many thousands of such objects the validation operation cannot complete within the default 30 second command timeout. In case this happens for the K2 DB, you just need to increase the timeout as explained above.
For custom databases which are frequently used as data sources, you need only a fraction of their objects exposed to K2 and this allows you to deny access to the K2 services account to the objects you don't need - this normally helps reduce validation time and resolve this issue without increasing default command timeout value.