SQL CommandTimeOut problem 
Author Message
 SQL CommandTimeOut problem


We recently Virtualised our servers.  Basically we had two physical
servers and now we have two vertual servers.

We run a couple of Web applications on the VM server.  We had
everything running fine for a while - until we got a timeout problem
with a search function. Basically a page doing a search call to SQL
server and that took more than the default SQL Command Execution
timeout which is set to 30 secs my MS.

To resolve that problem, we set CommandTimeout property of the
SQLCommand object as well as the
SQLConnection object - to 0 - this makes the timeout to be unlimited.

The code snippet below shows what we did:
Note: that the CommandTimeout is set at both the SQLConnection and
SQLCommand levels !!

>>> code snippet follows ...

aConnection = New SqlConnection
("Database=myDB;Trusted_Connection=True;Connection Timeout = 0;")

mCommand = New SqlCommand(strStoredProcedureName, aConnection)
mCommand.CommandType = CommandType.StoredProcedure
mCommand.CommandTimeout = 0


The question is: this stuffed up the Virtual Server memory. The
connection seems to consume the memory
really big time. From 4GB RAM down to 1GB RAM left in no time whenever
we run our application making
use of the above SQL Connection Statements.

We are not sure what caused the problem - but we decided to roll-back
to our old code and
remove the above SQL CommandTimeout Statements and left it to the
default 30secs.

This seemed to run the application and RAM consumption as normal and
happy.degradation which is of course

We suspected the above CommandTimeout code snippet to have the caused
the problem.

Any changes to any other code did not cause any memory problems.

==>> Also - the problem was apparent only in the Virtual Servers
network setup.
===> That is the application could run fine when hoseted on a local
IIS (personal web server)
===> making calls to the same SQL server ...

Will someone please tell me what exactly happened.

Can the CommandTimeout setting affect the RAM so much?



Mon, 12 Mar 2012 12:40:59 GMT  
 SQL CommandTimeOut problem
Multiposted to 4 different groups.

Mon, 12 Mar 2012 21:04:00 GMT  
 SQL CommandTimeOut problem

> Multiposted to 4 different groups.

Not to mention it's .NET code.

Mon, 12 Mar 2012 22:24:58 GMT  
 [ 3 post ] 

 Relevant Pages 

1. Clarification of default CommandTimeout property

2. CommandTimeout

3. ADO 2.5/OleDB CommandTimeout ?

4. Cancel an Command with commandTimeout

5. Is there a CommandTimeout property on ado.net oledb

6. CommandTimeout Does Not Timeout

7. Clarification of default CommandTimeout property

8. CommandTimeout

9. ADO CommandTimeOut property does not work

10. CommandTimeout on Oracle 7.3.4 does not work


12. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL


Powered by phpBB® Forum Software