The Wait Operation Timed Out. Asp

The wait operation timed out. ASP

If you found the exact error "The wait operation timed out" then it is likely you have a database call that took longer than expected. This could be due to any number of things:

  1. Transient network problem
  2. High SQL server load
  3. Problem with SAN, RAID, or storage device
  4. Deadlock or other form of multiprocess contention

You haven't shared enough information to troubleshoot. The way I would manage this would be to check for other occurrences of the problem and see if there is a pattern, e.g. if the problem occurs at a certain time of day.

Certainly increasing the timeout is not a bad idea (if it is currently set pretty low) and may resolve the problem in and of itself.

Asp.net web form The wait operation timed out

sdaFeedBack.SelectCommand.CommandTimeout=120; //or some other number of seconds.

Setting the timeout on the connection determines how long to wait for the connection to open, not for the command to execute.

How to fix the wait operation is timed out?

The error is pretty clear that tells you query execution has been dropped to timeout. So, you can refactor the query or increase the command timeout of _context;

public class SampleDbContext: DbContext
{
public SampleDbContext(string nameOrConnectionString) : base(nameOrConnectionString)
{
((IObjectContextAdapter)this).ObjectContext.CommandTimeout = 180;
}
}

The wait operation timed out in asp.net mvc 4

As vishal Naik has mentioned, SQL server has a default query timeout setting of 30 seconds. A possible solution would be to manually increase this time for a given query and this, while not recommended, should be effective. The code is as follows:

SqlCommand cmd = new SqlCommand(commandText, conn);
cmd.CommandTimeout = 60; // or any other length of time in seconds
/*Any other properties to be modified in the command will come here*/
SqlDataReader dataReader = cmd.ExecuteReader();


Related Topics



Leave a reply



Submit