Questions tagged [command-timeout]
53 questions
3
votes
1 answer
INSERT timeout during online index rebuild
Is there a way to prevent SQL INSERT timeouts during SQL Server index rebuild/reorganize operations? We are using NHibernate, command timeout set at 10 minutes, SQL Server 2008 R2, index rebuild is being done online.

vgru
- 49,838
- 16
- 120
- 201
3
votes
1 answer
manually increasing SQL server command timeout
I had a test windows host (50 MB) which was serving my ASP.NET web app, it worked almost fine, but after it was upgraded to 100 MB, I got frequent SQL server timeout errors when trying to remotely connect SQL server from Visual Studio (i.e. in local…

Ali_dotNet
- 3,219
- 10
- 64
- 115
3
votes
2 answers
Change CommandTimeout of SSIS OleDB Source programmatically?
in a quite big project we recently received the request to execute certain SSIS packages during regular business hours. However, while the package can take as long as it needs during the night, during working hours it is most important to stop…

Tyron78
- 4,117
- 2
- 17
- 32
3
votes
2 answers
How to respect CommandTimeout when using Dapper.NET async API
I noticed that using the asynchronous API in Dapper.NET the command timeout value I pass in the extension method is not respected.
Then I came across the MSDN documentation of the SqlCommand.CommandTimeout and it seems that this is something it is…

George Taskos
- 8,324
- 18
- 82
- 147
3
votes
2 answers
Timeout exception when timeout set to infinite time
In my C# .NET 3.5 application I am using CastleProject ActiveRecord over NHibernate. This is desktop application using MS SQL Server 2008. I have set ADO command timeout to 0 to prevent timeout exception during bulk operations:
…

Alex
- 1,357
- 3
- 18
- 41
3
votes
1 answer
Is there any negative effect to setting SqlCommand's CommandTimeout to a high value?
It seems that I was running into some random issues with a Stored Procedure when it took longer than the default timeout value; I was advised of that here.
So I increased the value, and it seems to have helped.
But it makes me wonder: Why not just…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
3
votes
3 answers
sqlclient - connection timeout or command timeout
I get the following error upon running a query.
*
System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the server is not responding. at…

SoftwareGeek
- 15,234
- 19
- 61
- 78
3
votes
3 answers
Setting CommandTimeout in Microsoft's Data Access Application Block (SQLHelper)
I'm using the Data Access Application Block (SQLHelper) to execute SQL against a database. I have one query which takes longer than the default command timeout of 30 seconds. I want to up the timeout, but I don't see any way to do so without…

Mashmagar
- 2,556
- 2
- 29
- 38
3
votes
2 answers
Setting Linq to NHibernate ADO Command Timeout
How do I increase the timeout in NHibernate Linq To Sql?
Not the Connection Timeout but the ado command timeout.
using (ISession session = NHibernateHelper.OpenSession(NHibernateHelper.Databases.CarrierCDR))
using…

DarrenMcD
- 31
- 4
2
votes
0 answers
DBContext Command Timeout: Why use IObjectContextAdapter?
So, I'm writing this code to Execute a stored procedure which is getting timed out in 30 seconds (which after some search I understood as the default value). When I searched for a way to increase the CommandTimeout, I got many answers which…

Flemin Adambukulam
- 853
- 8
- 18
2
votes
1 answer
What would cause/how can I prevent a ContextSwitchDeadlock?
I have a rather long-running process in a Windows Service that periodically throws a "ContextSwitchDeadlock" exception:
I have also rigged my service to send myself emails with details about encountered exceptions. I get:
Date: 05/25/2016…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
2
votes
2 answers
Change CommandTimeout Default Value globally
We migrated some piece of old software to a new server. We used SQL Server 2008 Enterprise in the past and now we are using SQL Server 2014 Enterprise on a new machine, so it should be faster now.
The old software is legacy software and about to…

Mr. T
- 65
- 1
- 8
2
votes
2 answers
WebMatrix Database.Query with Custom CommandTimeout
Consider the following TestDb with TestTable and Procedure
USE TestDb
GO
--DROP TABLE dbo.TestTable
IF NOT EXISTS (SELECT 1 FROM sys.tables WHERE name = 'TestTable')
BEGIN
CREATE TABLE dbo.TestTable
(
RecordId int NOT NULL…

cusman
- 1,711
- 1
- 17
- 17
2
votes
2 answers
How to timeout "A network-related or instance-specific error occurred while establishing a connection to SQL Server" error
I am using sql server and sometimes my database goes down for maintenance. I have error handling code so the user don't see error page, instead they see a nice and friendly error message. My question is: When the database is down, It takes an…

user1
- 1,063
- 1
- 8
- 28
1
vote
1 answer
How to set command timeout for entity objectcontext
I have a repository file in which we have created object context of entity type and not of ObjectContext class type
public class ShopRepository : GenericRepository
{
// Entity Framework context to the database
private…

Keren Caelen
- 1,466
- 3
- 17
- 38