SQL Helper, General Network Error, & CommandTimeout

G

Guest

I've got a potentially long running SQL Server stored procedure. Worst case it may run 6 minutes. Using the SQL Helper ExecuteDataset() method, I'm receiving a "General Network Error" if the procedure runs longer than 35 seconds. It runs to completion if the parameters result in a shorter run time

I assumed that it was because of a command timeout so I modified the SQLHelper class to set the SQLCommand.CommandTimeout value where necessary. Once set this way, the procedure runs to completion, but the CommandTimeout value that I set doesn't seem to make any difference. I can set it to 10 sec or 500 sec and the procedure still runs the 6 minutes or so required and completes

My question is: Does anyone understand what's going on here? Setting commandtimeout removed the "General Network Error" but I'm not sure why, and why does changing the timeout setting not make any difference as far as a timeout

It may help to know that the stored procedure creates a cursor (I know) and runs through it to put records into a temp table, then I select from the temp table to return the records

I use the MS Exception Blocks to log the error. The info follows

2) Exception Informatio
********************************************
Exception Type: System.Data.SqlClient.SqlExceptio
Errors: System.Data.SqlClient.SqlErrorCollectio
Class: 2
LineNumber:
Message: General network error. Check your network documentation
Number: 1
Procedure: ConnectionRead (recv())
Server:
State:
Source: .Net SqlClient Data Provide
TargetSite: System.Data.SqlClient.SqlDataReader ExecuteReader(System.Data.CommandBehavior, System.Data.SqlClient.RunBehavior, Boolean
HelpLink: NUL

StackTrace Informatio
********************************************
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\Data Access v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 56
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\Data Access v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 47
at SWatchData.clsStyle.GetStyleDeleteList(clsDepartmentChoices objDepartmentChoices, clsVendorChoices objVendorChoices, clsStylePeriodChoices objStylePeriodChoices, TimePeriod TimePeriodChoice) in c:\files\stockwatch\swatch.net\SWatch\SWatchData\clsStyle.vb:line 443

Any help would be appreciated!

Thanks. D. Arnold
 
B

Bernie Yaeger

Hi,

Don't have a good answer for you, expect to suggest you look at the hidden
code re what the timeout is actually set to. I have added commandtimeout
changes for precisely the same reasons and they do time out if not set high
enough, so my system is acknowledging the new timeout. The default, btw, is
30 seconds, as you may have already guessed.

HTH,

Bernie Yaeger

D. Arnold said:
I've got a potentially long running SQL Server stored procedure. Worst
case it may run 6 minutes. Using the SQL Helper ExecuteDataset() method, I'm
receiving a "General Network Error" if the procedure runs longer than 35
seconds. It runs to completion if the parameters result in a shorter run
time.
I assumed that it was because of a command timeout so I modified the
SQLHelper class to set the SQLCommand.CommandTimeout value where necessary.
Once set this way, the procedure runs to completion, but the CommandTimeout
value that I set doesn't seem to make any difference. I can set it to 10 sec
or 500 sec and the procedure still runs the 6 minutes or so required and
completes.
My question is: Does anyone understand what's going on here? Setting
commandtimeout removed the "General Network Error" but I'm not sure why, and
why does changing the timeout setting not make any difference as far as a
timeout?
It may help to know that the stored procedure creates a cursor (I know)
and runs through it to put records into a temp table, then I select from the
temp table to return the records.
I use the MS Exception Blocks to log the error. The info follows:

2) Exception Information
*********************************************
Exception Type: System.Data.SqlClient.SqlException
Errors: System.Data.SqlClient.SqlErrorCollection
Class: 20
LineNumber: 0
Message: General network error. Check your network documentation.
Number: 11
Procedure: ConnectionRead (recv()).
Server:
State: 0
Source: .Net SqlClient Data Provider
TargetSite: System.Data.SqlClient.SqlDataReader
ExecuteReader(System.Data.CommandBehavior,
System.Data.SqlClient.RunBehavior, Boolean)
HelpLink: NULL

StackTrace Information
*********************************************
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(Comman
dBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlConnection
connection, CommandType commandType, String commandText, SqlParameter[]
commandParameters) in C:\Program Files\Microsoft Application Blocks for
..NET\Data Access
v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 560
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application
Blocks for .NET\Data Access
v2\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:line 475
at SWatchData.clsStyle.GetStyleDeleteList(clsDepartmentChoices
objDepartmentChoices, clsVendorChoices objVendorChoices,
clsStylePeriodChoices objStylePeriodChoices, TimePeriod TimePeriodChoice) in
c:\files\stockwatch\swatch.net\SWatch\SWatchData\clsStyle.vb:line 443
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top