This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

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:

Image

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):

Image

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)\K2\Host Server\Bin"
  • Search for "commandtimeout" keyword - there should be 2 entries, and then edit the following line

<sourcecode.smartobjects.runtime smartObjectDependencyClassId="9812F4EA-75C9-48C1-83DB-578FCCE0CBC7" smartObjectServicesDependencyClassId="BB063376-0A7B-4849-BE59-49CDF511DC91" smartObjectServicesTypeDependencyClassId="EA60367A-5E41-4889-8F64-E1E494A77675" servicebrokerpath="C:\Program Files (x86)\K2\ServiceBroker" bufferrecords="20000" allowexponent="false" commandtimeout="30">
  • 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.

Very frequently such timeout issues can be caused by the large number of objects in the target database. When registering or updating the service instance, the K2 service account verifies each and every database object it has access to (every single view, table and stored procedure).
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.