Sometimes the error "ORA-00933" occurs when using the entity structure to query the Oracle database, but when I restart the webapp, it works

I used Entity Framework 5 for the Oralce database for the web application. Sometimes (rarely), the error "ORA-00933" occurs, but when I restart the webapp, it again gets the job. This is the log:

System.Data.EntityCommandExecutionException: An error occurred while executing a command definition. See Internal Exception for more details. ---> Oracle.ManagedDataAccess.Client.OracleException: ORA-00933: the SQL command did not finish correctly on OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution (OracleConnectionImpl connectionImpl, Int32 & cursorId, Boolean bThrowArrayBindRelatedErrorBleRarBleRumRleBleRerBleRumRleBlrrmeBleRerBleRlrmeBleRerBleRleRlbmeRlerBlerrbmlrExrblerrblermerlerblerrblermerlerblerrbbml bFirstIterationDone) in OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader (String commandText, OracleParameterCollection paramColl, CommandType commandType, connection OracleConnectionImplImpl, OracleDataReaderImpl & rdrImpl, Int32enclp, Int64dplplpl, Int64Declpl, Int64Declpl, Int64client, Int64client, Int64client, Client64Int64 [] & scnFromExecution, OracleParameterCollection & bindByPositionParamColl, Boolean & bBindParamPresent, Int64 & internalInitialLOBFS, OracleException & exceptionForArrayBindDML, Boolean isDescribeOnly.Relement.Commenteaeclementiment .ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader (CommandBehavior behavior) when System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands (entityCommand entityCommand, CommandBehavior behavior) --- End inner exception stack trace --- at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands (EntityCommand entityCommand, CommandBehavior behavior) under System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute [TResultType] (ObjectContext context, parameter ObjectParameterCollection parameterValues) in System.Data.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption) at System.Data.Objects.ObjectQuery 1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source) in System.Linq.Queryable.SingleOrDefault [TSource] (IQueryable`1 source)
in MOS.DAO.HisTreatment.HisTreatmentGet.GetById (Int64 id, Search for it in the search service )

This is the code "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;

I tried searching on google but no solution. Can anyone give me some advice?

+6
source share
1 answer

There is a bug in the Entity Framework provider from Oracle.

, Oracle.ManagedDataAccess.EntityFramework.SqlGen.SqlSelectStatement.Top_s , . ( ), - ( , , SqlGenerator).

https://community.oracle.com/thread/3728543

Oracle. nuget: 12.2.110. , ​​ .

+1

Source: https://habr.com/ru/post/1016689/


All Articles