CommandTimeout not working

Posts   
 
    
Posts: 13
Joined: 03-Feb-2012
# Posted on: 03-Feb-2012 09:44:19   

Hi guys,

I have been trying to solve a problem for a client with timeouts on stored procedure calls. We are using LLBLGen (2.6, self servicing) to call stored procedures through

RetrievalProcedures.MyProc()

then using

IDataReader reader = dao.GetAsDataReader

Then using reader.Read(). This all works fine except for I cannot get the timeout to work with anything but the default 30 secs. I have even hard coded

DB.HelperClasses.DbUtils.CommandTimeOut = 120;

And can confirm it is correct in the debugger immediately before the procedure is called but still it times out after 30 seconds. Does the Timeout even work for stored procedures? or is it just for use on views or entities?

Regards,

Rich

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Feb-2012 10:35:46   

Would you please make sure you are using the latest release of v.2.6

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 03-Feb-2012 17:32:58   

It should, but we think it's a bug. We found the same bug in v3 some time ago. We'll port a fix back for you to v2.6. This will be on monday.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 06-Feb-2012 14:41:01   

It simply works in sqlserver templates, as you can see in DbUtils: check CallActionStoredProcedure and CallRetrievalStoredProcedure.

What database are you using and does it still happen in the latest build? (it's in the templates so you have to re-generate the code with the latest build)

Frans Bouma | Lead developer LLBLGen Pro
Posts: 13
Joined: 03-Feb-2012
# Posted on: 06-Feb-2012 22:18:29   

Thanks for the info guys. Dug through the templates and found the problem - I'm using RetrievalProcedures so have to set the timeout for each query like so:

  using (var query = RetrievalProcedures.GetProcMySPCallAsQuery())
  {
                    query.SetCommandTimeout(DB.HelperClasses.DbUtils.CommandTimeOut);
       ...
       ...
   }

Which works a charm.

Thanks,

Rich

epiazza
User
Posts: 4
Joined: 09-Sep-2008
# Posted on: 05-Feb-2013 21:28:49   

Hi, I am having the same problem mentioned in this post, I'm using Self-Servicing, LLBLGen Pro 3.0 to .NET 4.0. I use the following code directly before my stored procedure call, and it does increase the timeout beyond 30 seconds.

DAL.DaoClasses.CommonDaoBase.CommandTimeOut = 45

I think it was mentioned that this is a known bug in v3?

It should, but we think it's a bug. We found the same bug in v3 some time ago. We'll port a fix back for you to v2.6. This will be on monday.

If this is true, where can I find a fix for this bug?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Feb-2013 07:12:53   

epiazza wrote:

Hi, I am having the same problem mentioned in this post, I'm using Self-Servicing, LLBLGen Pro 3.0 to .NET 4.0. I use the following code directly before my stored procedure call, and it does increase the timeout beyond 30 seconds.

DAL.DaoClasses.CommonDaoBase.CommandTimeOut = 45

So, it won't work if you put that outside the SP method call?

epiazza wrote:

I think it was mentioned that this is a known bug in v3? ... If this is true, where can I find a fix for this bug?

Are you using the latest runtimer library version? (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7717)

Note: in the future please don't re-open old threads. Open a new one instead wink

David Elizondo | LLBLGen Support Team