Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> ActionProcedure is timing out
 

Pages: 1
LLBLGen Pro Runtime Framework
ActionProcedure is timing out
Page:1/1 

  Print all messages in this thread  
Poster Message
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 19-Jun-2008 01:23:51.  
I am using an adapter

using (DataAccessAdapter adapter = new DataAccessAdapter()) {

I create a new entity and save it ... no problem.

I then call an actionProcedure and it times out.
}

I have read where I can set
     adapter.CommandTimeOut = 120;
and I do set this after the saveEntity and immediately prior to calling the actionProcedure

and in debugging the code I do see that the adaptor commandtimeout is set to 120 prior to executing the actionProcedure. However, the procedure times out after 30 seconds.

Am I missing something?

Here is a little more info
SQL Server 2005 Dev Edition running on a laptop
LLBLGen v2.x
ASP.Net 2.0 / VS 2005
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 19-Jun-2008 11:08:49.  
Are you sure you don't need to set the connection timeout?
Please check this thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=5301

Please try to call this SP manually from the database tools, to see if it timeout or see how long it takes it to execute.



  Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 19-Jun-2008 11:57:30.  
Saw the other thread, not sure what you want me to take from it ... I have no problem connecting to the database, it is the command that is timing out.

The manual execute takes 35 seconds in Sql Management tools.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 19-Jun-2008 12:22:43.  
Just to make sure, when you call the actionStoredProcedure, would you be able to see the SP call in the SQL Profiler?

I have a feeling the application is facing problems finding or accessing the specified SP.


  Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 19-Jun-2008 12:25:13.  
the stored procedure is getting called ... as this SProc updates another table and it is getting through about 90 % of the list of things to process.

  Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 19-Jun-2008 14:37:57.  
I have taken the call to the Sproc out of the Using ( DataAccessAdaptor...){} and made it a using a separate adaptor and it is now working. Any thoughts on why this is needed?

  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 19-Jun-2008 15:20:14.  
No idea.
Would you please the exact non-working real code?
  Top
arschr
User



Location:
Atlanta, Georgia; USA
Joined on:
14-Dec-2003 16:57:29
Posted:
887 posts
# Posted on: 19-Jun-2008 15:48:21.  
Quote:
Any thoughts on why this is needed?

Have you checked for blocking in the database?


- Al  Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 19-Jun-2008 17:08:37.  
Here is a copy of the code ...

using (DataAccessAdapter adapter = new DataAccessAdapter()) {
    InvoiceEntity Invoice = new InvoiceEntity();
    Invoice.IsNew = true;
    Invoice.Locked = 0;
    VSIMSMasterPage daMasterPage = (VSIMSMasterPage)this.Master;
    Invoice.YearId = YearID;
    Invoice.orgId = daMasterPage.CurUserOrg.OrgId;
    Invoice.InvoiceMonth = month;
    Invoice.InvoiceType = InvoiceType.District.ToString();
    Invoice.Status = InvoiceStatus.New.ToString();
    Invoice.CreatedBy = Page.User.Identity.Name;
    Invoice.ModifiedBy = null;
    adapter.SaveEntity(Invoice, true);

    adapter.CommandTimeOut = 120;
    ActionProcedures.InvoiceDataCollection(Invoice.InvoiceId);
}


and no there is no blocking issue within the db ...
  Top
JimHugh
User



Location:
Davis, CA
Joined on:
16-Nov-2005 14:32:25
Posted:
191 posts
# Posted on: 19-Jun-2008 20:18:29.  
I believe the command timeout can not be changed once the connection has been opened.

It gets opened when you do the SaveEntity. Try moving the CommandTimeout to the beginning, or at least before calling any methods on the adapter.

Since it is just a timeout, it shouldn't affect the save at all.

Code:

using (DataAccessAdapter adapter = new DataAccessAdapter()) {
    adapter.CommandTimeOut = 120;

    InvoiceEntity Invoice = new InvoiceEntity();
    Invoice.IsNew = true;
    Invoice.Locked = 0;
    VSIMSMasterPage daMasterPage = (VSIMSMasterPage)this.Master;
    Invoice.YearId = YearID;
    Invoice.orgId = daMasterPage.CurUserOrg.OrgId;
    Invoice.InvoiceMonth = month;
    Invoice.InvoiceType = InvoiceType.District.ToString();
    Invoice.Status = InvoiceStatus.New.ToString();
    Invoice.CreatedBy = Page.User.Identity.Name;
    Invoice.ModifiedBy = null;
    adapter.SaveEntity(Invoice, true);

    ActionProcedures.InvoiceDataCollection(Invoice.InvoiceId);
}


Jim Hughes  Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 19-Jun-2008 20:45:22.  
yup, thought about that as well and moved the change timeout to the top after the using ... same thing.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 20-Jun-2008 09:59:30.  
Try to keep the connection open as follows.

using (DataAccessAdapter adapter = new DataAccessAdapter(true)) {
    adapter.CommandTimeOut = 120;

    InvoiceEntity Invoice = new InvoiceEntity();
    Invoice.IsNew = true;
    Invoice.Locked = 0;
    VSIMSMasterPage daMasterPage = (VSIMSMasterPage)this.Master;
    Invoice.YearId = YearID;
    Invoice.orgId = daMasterPage.CurUserOrg.OrgId;
    Invoice.InvoiceMonth = month;
    Invoice.InvoiceType = InvoiceType.District.ToString();
    Invoice.Status = InvoiceStatus.New.ToString();
    Invoice.CreatedBy = Page.User.Identity.Name;
    Invoice.ModifiedBy = null;
    adapter.SaveEntity(Invoice, true);

    ActionProcedures.InvoiceDataCollection(Invoice.InvoiceId);
}


  Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 20-Jun-2008 14:01:28.  
nope ... same thing right at 30 seconds the sproc call is stopped.

  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38044 posts
# Posted on: 20-Jun-2008 16:51:24.  
You have to use the overload of the proc call method which accepts an adapter Regular Smiley Otherwise it will create a new one and will of course use the default timeout. So set the timeout and then pass it to the overload:

using (DataAccessAdapter adapter = new DataAccessAdapter()) {
    adapter.CommandTimeOut = 120;

    InvoiceEntity Invoice = new InvoiceEntity();
    Invoice.IsNew = true;
    Invoice.Locked = 0;
    VSIMSMasterPage daMasterPage = (VSIMSMasterPage)this.Master;
    Invoice.YearId = YearID;
    Invoice.orgId = daMasterPage.CurUserOrg.OrgId;
    Invoice.InvoiceMonth = month;
    Invoice.InvoiceType = InvoiceType.District.ToString();
    Invoice.Status = InvoiceStatus.New.ToString();
    Invoice.CreatedBy = Page.User.Identity.Name;
    Invoice.ModifiedBy = null;
    adapter.SaveEntity(Invoice, true);

    ActionProcedures.InvoiceDataCollection(Invoice.InvoiceId, adapter);
}

You can set the timeout whenever you like, it's not necessary to set it before the connection is opened, as this timeout is for commands, which are created on the fly. Setting it right after the using statement of course also uses this timeout for the SaveEntity call.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
JeffStone
User



Location:

Joined on:
19-Jun-2008 00:46:13
Posted:
8 posts
# Posted on: 20-Jun-2008 17:02:12.  
shear genius ... that was it and it makes sense ... I very much appreciate everyone's help.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.