In our asp.net website project, we are receiving the following error when attempting to use context.ExecuteScalar or context.ExecuteQuery:
-------------------------------------------------------------------------------------------
Application Error:
-------------------------------------------------------------------------------------------
Object reference not set to an instance of an object.
at
Telerik.OpenAccess.Data.Common.OAConnection.SetupConverters(OADataReader
oaDataReader)
at
Telerik.OpenAccess.Data.Common.OACommand.ExecuteReader(CommandBehavior
behavior)
at
Telerik.OpenAccess.OpenAccessContextBase.ExecuteQuery[T](String commandText,
CommandType commandType, DbParameter[] parameters)
at PW.WEF.Web.WEFM001.Page_Load(Object sender, EventArgs a)
at
System.Web.UI.Control.LoadRecursive()
at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint)
-------------------------------------------------------------------------------------------
Detailed Error:
-------------------------------------------------------------------------------------------
Object reference not set to an instance of an object.
-------------------------------------------------------------------------------------------
HTTP Error 500:
-------------------------------------------------------------------------------------------
Exception of type 'System.Web.HttpUnhandledException' was
thrown.
System.Web
at
System.Web.UI.Page.HandleError(Exception e)
at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)
at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint)
at
System.Web.UI.Page.ProcessRequest()
at
System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
The queries causing this are not complex. For example, here is one place that has caused this error:
public
DateTime cp_db_date_time()
{
string
sQuery =
"select SYSDATE from dual"
;
return
this
.ExecuteScalar<DateTime>(sQuery);
}
This does not happen all the time. I haven't been able to reproduce it locally, but when the production site starts to get hit hard during the busy parts of the day, this error crops up sporadically. There are about 10 or so places where we use ExecuteQuery or ExecuteScalar and the error always occurs around one of these spots. It does not occur any other time we access the database via linq queries and such.
Any ideas as to why this is happening?