Hi,
I have created a web-service and hosted in localhost which is doing some database operation through single static LINQ DBcontext Object. And this web-service is consumed by another windows service hosted in same machine which is using tread so multiple thread is hitting my webservice simultaneously and every thread perform their task nicely but SOMETIMES we are receiving following kind of errors.
Object reference not set to an instance of an object.
StackTrace: at System.Data.Linq.SqlClient.SqlConnectionManager.BootUser(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
at SMS.BLL.Subscriber.GetSubscriberByID(Guid p_subscriberID)
=====================================================
Index was outside the bounds of the array.
StackTrace: at System.Collections.Generic.List`1.RemoveAt(Int32 index)
at System.Data.Linq.SqlClient.SqlConnectionManager.BootUser(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at SMS.BLL.SMSDataClassesDataContext.SMS_INSERTMT(String sUBSCRIBERID, XElement mESSAGEXML)
at SMS.BLL.Subscriber.SaveMTMessages(Guid SubscriberID, Byte[] smsInfoCompressed, String EncodingName)
Can anybody help me please?
Thanks
Rohit