这是日志:
System.Data.EntityCommandExecutionException: An error occurred while
executing the command definition. See the inner exception for details.
—> Oracle.ManagedDataAccess.Client.OracleException: ORA-00933: sql command not properly ended at
OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution(OracleConnectionImpl
connectionImpl,Int32& cursorId,Boolean bThrowArrayBindRelatedErrors,
OracleException& exceptionForArrayBindDML,Boolean& hasMoreRowsInDB,
Boolean bFirstIterationDone) at
OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String
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) at
Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean
requery,Boolean fillRequest,CommandBehavior behavior) at
Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior
behavior) at
System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand
entityCommand,CommandBehavior behavior) — End of inner exception
stack trace — at
System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand
entityCommand,CommandBehavior behavior) at
System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext
context,ObjectParameterCollection parameterValues) at
System.Data.Objects.ObjectQuery1.GetResults(Nullable
1
forMergeOption) at
System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
1
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
source) at
System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
at MOS.DAO.HisTreatment.HisTreatmentGet.GetById(Int64 id,
HisTreatmentSO search)
这是代码“HisTreatmentGet.GetById”:
HIS_TREATMENT result = null; try { bool valid = true; using (var ctx = new AppContext()) { var query = ctx.HIS_TREATMENT.AsQueryable().Where(p => p.ID == id); ... result = query.SingleOrDefault(); } } catch (Exception ex) { .... } return result;
Seems like the Oracle.ManagedDataAccess.EntityFramework.sqlGen.sqlSelectStatement.Top_s is the culprit that gets borrowed by a parallel query. This should either be thread static (quick hack) or moved to some contextual state (proper fix,e.g. to sqlGenerator).
https://community.oracle.com/thread/3728543
Oracle支持部门没有回答.话虽如此,有一个新版本的nuget包:12.2.110.您可以尝试一下,检查问题是否已修复.