StoredProcedure T imeout in v3

Posts   
 
    
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 03-Sep-2010 14:40:56   

How do I replicate the code below in v3 (self servicing, vb.net, MS SQLServer) where there is no DbUtils?

Dim OldTimeout As Integer = DbUtils.CommandTimeOut DbUtils.CommandTimeOut = 120 DbUtils.CallRetrievalStoredProcedure("[AccountsDb].[dbo].[MismatchFilter]", parameters, MisMatchData, Nothing) DbUtils.CommandTimeOut = OldTimeout

I can use the StoredProcedureCallerClasses.RetrievalProcedures to call the stored procedure but how can I set the timeout?

Thanks for your help and sorry for the multiple questions across the various forums (all about different problems though at least!)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Sep-2010 18:06:55   
Frans Bouma | Lead developer LLBLGen Pro
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 06-Sep-2010 11:36:03   

This doesn't seem to be working.

I was previously using DbUtils.CallRetrievalStoredProcedure but since that doesn't exists now, I've defined the stored procedure in the generated code and I'm using the stored procedure caller class.

AccountsDB.DaoClasses.CommonDaoBase.CommandTimeOut = 120
Dim StartTime As DateTime = Now
Try
    MisMatchData = AccountsDB.StoredProcedureCallerClasses.RetrievalProcedures.InvoiceMismatchFilter(SelectedDate)
Catch ex As SqlClient.SqlException
    Dim EndTime As DateTime = Now
    MsgBox("Error fetching MisMatch Data")
End Try

The timeout exception fires after 30 seconds. I tried setting the SQL Server Compatilibilty Level to SqlServer2000 but it hasn't made any difference.

Does the stored procedure caller class use the CommonDaoBase command timeout?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 06-Sep-2010 15:14:51   

It might be that you have defined it wrong. You should define it as the generated code does: Return New StoredProcedureCall(dataAccessProvider, "[sotaas].[dbo].[AirPlusJournalCheck]", "AirPlusJournalCheck") _ .AddParameter("@Period", "VarChar", 5, ParameterDirection.Input, True, 0, 0, period) _ .AddParameter("@SalesLedgerDatePlus1", "DateTime", 0, ParameterDirection.Input, True, 0, 0, salesLedgerDatePlus1)

(In RetrievalProcedures.vb).

If this is what you are already doing, the please post the proc call def.

JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 06-Sep-2010 15:37:10   

Sorry, I don't understand what you're suggesting or what you're asking.

What should I be defining?

All I'm doing is using one line of code to set the timeout, and another to call the function from the RetrievalProcedures class which only has two possible sets of arguements - a date or a date and an ITransaction.

It seems that it is working in terms of calling the stored procedure, it's just that the modified timeout is not being used and it's timing out after 30 seconds.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Sep-2010 17:37:23   

I used your project from the other thread, generated code and didn't see the method you refer to in your code, so additionally to what you said: "I was previously using DbUtils.CallRetrievalStoredProcedure but since that doesn't exists now", we concluded that you defined a custom stored procedure call in code which is now outdated / doesn't follow the code path set up for stored procs in v3.

As this is an assumption, could you please tell us why you said "I was previously using DbUtils.CallRetrievalStoredProcedure but since that doesn't exists now" ? simple_smile Is the proc you refer to in your post a generated proc call or a method call you added yourself? If you defined it yourself, you have to rewrite it to follow the pattern we use in the generated code now for calling stored procedures. (it's really simple, see the generated retrievalprocedures class).

If the proc is generated, then our assumption is wrong and we'll look into whether everything is indeed wired up correctly. Sorry for the confusion simple_smile

Frans Bouma | Lead developer LLBLGen Pro
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 06-Sep-2010 17:42:31   

No worries. The stored procedure wasn't in the generated code previously, which is why I used, DbUtils.CallRetrievalStoredProcedure. It is now. The actual name is AirPlusInvoiceMismatchFilter - I often trim things to aid readability - didn't realise you'd be looking at the attachment on the other thread!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Sep-2010 17:44:14   

JMitchell wrote:

No worries. The stored procedure wasn't in the generated code previously, which is why I used, DbUtils.CallRetrievalStoredProcedure. It is now. The actual name is AirPlusInvoiceMismatchFilter - I often trim things to aid readability - didn't realise you'd be looking at the attachment on the other thread!

That was the easiest way to look how the proc was setup in your vb.net code simple_smile

We'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Sep-2010 10:42:03   

Reproduced. Looking into it.

(edit) bug, timeout isn't set for a proc call. Working on fix. The reason it's not set is because the proc is not a SQL command created by the DQE. The timeout is set on the DQE, and the proc call is not called as a generated query, but directly, so the parameter isn't set.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Sep-2010 11:15:16   

Please see the attached dll for the fix.

Adapter doesn't have this problem btw, it's only Selfservicing, and also only stored procs. Normal commands do get the timeout set.

Frans Bouma | Lead developer LLBLGen Pro
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 07-Sep-2010 11:25:14   

That's great, Thanks for your help. Much appreciated (I assume this fix will be in the next relese?)

bentos
User
Posts: 144
Joined: 12-Jul-2006
# Posted on: 27-Sep-2010 14:05:44   

Cool and thanks, just come across this problem now with an actionprocedure call timeout in .net4, I will try current release.