加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

有时,使用实体框架查询Oracle DB时会出现错误“ORA-00933”但是

发布时间:2020-12-12 13:08:09 所属栏目:百科 来源:网络整理
导读:我已经将Entity Framework 5用于基于Web的应用程序的Oralce数据库.有时(很少发生),出现错误“ORA-00933”但是当我重新启动webapp时,它再次起作用. 这是日志: System.Data.EntityCommandExecutionException: An error occurred while executing the command
我已经将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.您可以尝试一下,检查问题是否已修复.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读