The timeout period elapsed prior to completion of the operation or the server is not responding.

Topics: Administration, Core, Customizing Orchard, General, Jobs, Troubleshooting
Dec 16, 2014 at 10:39 AM
Edited Dec 16, 2014 at 10:41 AM
Hello,
I created new table called Conversion and while i am inserting into this table i am trying to know how many records inserted by query against this table as below

public int GetCount(int queueTableId)
    {
        return _conversionRepository.Table.Where(record => record.QueueTableId == queueTableId).Count();

    }
Note : i am inserting around 100000 record using multi threads.
but i am get below error

2014-12-16 12:26:41,820 [11] NHibernate.AdoNet.AbstractBatcher - Could not execute query: select cast(count(*) as INT) as col_0_0_ from miu_MiLogik_MiUtility_Registration_ConversionPartRecord conversion0_ where conversion0_conversion0_.QueueTableId=@p0 System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\AdoNet\AbstractBatcher.cs:line 223
ClientConnectionId:f0a55a59-800f-4888-85d3-1dbb80163292
Dec 19, 2014 at 3:27 PM
Maybe you are quering for count too early and table is still locked.
Jan 5, 2015 at 6:13 PM
Did you figure out why?