一些空闲时间之后的Oracle Connection错误

时间:2016-11-29 17:36:39

标签: asp.net-mvc oracle database-connection

我在asp.net mvc中有一个使用Oracle数据库的项目。当我在很短的时间内发出请求时,它在localhost上工作得很好,在一些空闲时间之后,如果我发出相同的请求,我会得到错误(System.Net.Sockets.SocketException):

  

连接尝试失败,因为连接方没有   在一段时间后正确回应,或建立连接   失败,因为连接的主机无法响应

Linha 306:            produto = produto.Where(x => x.DESC_PRODUTO.ToUpper().Contains(palavra1));
Linha 307:            }
Linha 308: ===>        var categoria = await (from b in db2.MGL_PRODUTOS_GRUPO_SITE_VW 
Linha 309:                                   join p in produto on b.ID equals p.COMGPRO_ID

Linha错误:308

  

[SocketException(0x274c):Uma tentativadeconexãofalhouporque o   componente conectadonãoresponsedecorretamenteapósumperiíodode   节奏你是一个conexãentertruelecidafalhou porque o hostconectadonão   respondeu] System.Net.Sockets.Socket.Receive(Byte [] buffer,Int32   offset,Int32 size,SocketFlags socketFlags)+106
  OracleInternal.Network.ReaderStream.Read(OraBuf OB)+85

     

[NetworkException(0x80004005):ORA-12570:SessãodeRede:Erro de   leitura de pacote inesperado]
  OracleInternal.Network.ReaderStream.Read(OraBuf OB)+258
  OracleInternal.TTC.OraBufReader.GetDataFromNetwork()+ 205   OracleInternal.TTC.OraBufReader.Read(Boolean bIgnoreData)+52
  OracleInternal.TTC.MarshallingEngine.UnmarshalUB1(Boolean bIgnoreData)   +15 OracleInternal.TTC.TTCExecuteSql.ReceiveExecuteResponse(Accessor []&   defineAccessors,Accessor [] bindAccessors,Boolean   bHasReturningParams,SQLMetaData& sqlMetaData,SqlStatementType   statementType,Int64 noOfRowsFetchedLastTime,Int32 noOfRowsToFetch,   INT32和放大器; noOfRowsFetched,Int64& queryId,Int32 longFetchSize,Int64   initialLOBFetchSize,Int64 [] scnFromExecution,Boolean bAllInputBinds,   Int32 arrayBindCount,DataUnmarshaller& dataUnmarshaller,   MarshalBindParameterValueHelper&安培; marshalBindParamsHelper,Int64 []&   rowsAffectedByArrayBind,Boolean bDefineDone,Boolean&   bMoreThanOneRowAffectedByDmlWithRetClause,List`1& implicitRSList,   Boolean bLOBArrayFetchRequired)+2908

     

[OracleException(0x80004005):ORA-12570:SessãodeRede:Erro de   leitura de pacote inesperado]
  Oracle.ManagedDataAccess.Client.OracleException.HandleError(OracleTraceLevel   level,OracleTraceTag标记,Exception ex,OracleLogicalTransaction   oracleLogicalTransaction)+1218
  OracleInternal.TTC.TTCExecuteSql.ReceiveExecuteResponse(访问器[]&安培;   defineAccessors,Accessor [] bindAccessors,Boolean   bHasReturningParams,SQLMetaData& sqlMetaData,SqlStatementType   statementType,Int64 noOfRowsFetchedLastTime,Int32 noOfRowsToFetch,   INT32和放大器; noOfRowsFetched,Int64& queryId,Int32 longFetchSize,Int64   initialLOBFetchSize,Int64 [] scnFromExecution,Boolean bAllInputBinds,   Int32 arrayBindCount,DataUnmarshaller& dataUnmarshaller,   MarshalBindParameterValueHelper&安培; marshalBindParamsHelper,Int64 []&   rowsAffectedByArrayBind,Boolean bDefineDone,Boolean&   bMoreThanOneRowAffectedByDmlWithRetClause,List`1& implicitRSList,   Boolean bLOBArrayFetchRequired)+3275
  OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(字符串   commandText,OracleParameterCollection paramColl,CommandType   commandType,OracleConnectionImpl connectionImpl,   OracleDataReaderImpl和放大器; rdrImpl,Int32 longFetchSize,Int64   clientInitialLOBFS,OracleDependencyImpl orclDependencyImpl,Int64 []   scnForExecution,Int64 []& scnFromExecution,OracleParameterCollection&   bindByPositionParamColl,Boolean& bBindParamPresent,Int64&   internalInitialLOBFS,OracleException& exceptionForArrayBindDML,   Boolean isDescribeOnly,Boolean isFromEF)+14183
  Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(布尔   requery,Boolean fillRequest,CommandBehavior behavior)+3150
  Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(的CommandBehavior   行为)+160
  System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(的CommandBehavior   行为,取消语音取消语言)+176
  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)+92
  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)+58
  System.Data.Entity.Core.EntityClient.Internal.d__c.MoveNext()   249

     

[EntityCommandExecutionException:执行时发生错误   命令定义。有关详细信息,请参阅内部异常。]
  System.Data.Entity.Core.EntityClient.Internal.d__c.MoveNext()   +334 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)+92
  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)+58
  System.Data.Entity.Core.Objects.Internal.d__0 1.MoveNext() +1515 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 System.Data.Entity.Utilities.CultureAwaiter
1.GetResult()   59

0 个答案:

没有答案