You are viewing limited content. For full access, please sign in.

Question

Question

Workflow Database Activities query time out

asked on November 25, 2013

 I am getting a "Query timeout expired" error while trying to query a large amount  of data using the Laserfiche workflow Custom Query activity to call an SQL stored Procedure, noting that this stored procedure takes around 10 min.

 

How can I change the default query timeout?

0 0

Answer

APPROVED ANSWER
replied on February 27, 2014

Workflow 9.1.1 included a number of improvements to the database activities and now has a way to set the timeout. From the release notes found here:

 

The Insert Data, Query Data, Update Data, and Custom Query activities now allow you to specify a custom timeout. (111381)

 

 

1 0

Replies

replied on November 25, 2013

Workflow currently uses the data source's default timeout. It cannot be changed at this time.

1 0
replied on November 25, 2013

Sounds like if you really wanted to extend the time of the timeout, then you will need to look up information regarding the management tools used to maintain that data source you need to connect to. 

 

I wish you good luck on this task.

0 0
replied on November 25, 2013

Maybe you might want to separate out your query into multiple queries to get a response sooner and not get the timeout. 

 

The timeout is set as a way to make sure things arent left hanging when querying a DB that may be unreachable or too slow. 

 

Alternatively, you might want to create a script/other procedure in which you take the information you need from the DB you need it and store it to a temporary holding DB that you can then use a normal "Query Data" activity to grab such information. You would be able to set a wait for a metadata field or action to occur before doing the "Query Data" activity and you can have the wait take longer than 10 minutes without fear of an error or warning.

0 0
replied on November 25, 2013 Show version history

Hi Miled,

 

Before you extend the timeout, have you done every thing you can to optimise the database and query? Sorry if that sounds a bit obvious but it has to be asked. I'm suspicious of any query that takes so long and wonder if the query time will just continue to grow, unless the database and/query have been tuned.

 

Does the stored procedure create a dataset that is mostly static? Would generating the results once a day suffice or does the information need to be more up to date than that? If the dataset can be generated once a day, for example, then perhaps Kenneth's alternative approach might suffice.

 

I suspect there are better approaches that extending the time out and it would be very helpful to know about the scenario.

-Ben

 

0 0
replied on November 25, 2013

I agree with this, extending the timeout would be hazardous and only serve to be a workaround to a bigger issue that might still cause further delays in the future. It is always best to address the issue at hand than to work around it by accepting it as a given. Question the process and do as best you can to make the query optimized, then take alternative approaches like the one I suggested or Ben suggested

0 0
replied on November 26, 2013

Thank you all for your  responses, 


we have already optimized the Stored procedure as much as we can. This stored procedure is retrieving a huge number of records from different data sources.


Is there a way to change the SQL data source's default timeout? I am receiving the error after 30 seconds of execution, and I have checked the SQL remote query time out, it is 600 seconds.

 

0 0
replied on November 26, 2013

No, like i said above, there is no way to change it.

0 0
replied on November 26, 2013

You have several different data sources? Sounds like you might wanna break down the one query you have into multiple queries so that you can avoid the timeout and let the workflow instance information show you the major part of the delay in retrieving the information. This would help you get the results you want as well as moving forward you would be able to see which part is slowing down or the weak link and then focus on optimizing that query

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.