有时,使用实体框架查询Oracle DB时会出现错误“ORA-00933”但是当我重新启动webapp时,它会起作用

前端之家收集整理的这篇文章主要介绍了有时,使用实体框架查询Oracle DB时会出现错误“ORA-00933”但是当我重新启动webapp时,它会起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经将Entity Framework 5用于基于Web的应用程序的Oralce数据库.有时(很少发生),出现错误“ORA-00933”但是当我重新启动webapp时,它再次起作用.
这是日志:

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(Nullable1
forMergeOption) at
System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
1
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;

我试过谷歌搜索,但没有解决方案.有人可以给我建议吗?

Oracle的Entity Framework提供程序中存在一个错误.

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.您可以尝试一下,检查问题是否已修复.

猜你在找的Oracle相关文章