Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
---> Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-06550: line 15, column 458:
PLS-00382: expression is of wrong type
ORA-06550: line 17, column 458:
PLS-00382: expression is of wrong type
ORA-06550: line 19, column 458:
PLS-00382: expression is of wrong type
ORA-06550: line 21, column 458:
PLS-00382: expression is of wrong type
https://docs.oracle.com/error-help/db/ora-06550/
at Oracle.ManagedDataAccess.Client.OracleCommand.c.b__225_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
at Oracle.EntityFrameworkCore.Update.Internal.OracleModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
at Oracle.EntityFrameworkCore.Storage.Internal.OracleExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
Контекст
protected override void OnModelCreating(ModelBuilder modelBuilder){
modelBuilder.HasSequence("ORACLETABLE1_SEQ");
modelBuilder.HasSequence("ORACLETABLE2_SEQ");
modelBuilder.Entity(entity =>
{
entity.HasOnce(d => d.oracletable2)
.WithMany(p => p.oracletable1)
.HasPrincipalKey(p => p.guid)
.HasForeignKey(d => d.guid)
.HasConstraintName("FK_ORACLETABLE1_ORACLETABLE2");
OraclePropertyBuilderExtensions.UseHiLo(entity.property(p => p.table2ID),"ORACLETABLE2_SEQ");
});
modelbuilder.Entity(entity =>
{
OraclePropertyBuilderExtensions.UseHiLo(entity.property(p => p.table1ID),"ORACLETABLE1_SEQ");
entity.Property(p => p.item1).IsUniCode(false);
entity.Property(p => p.guid).IsUniCode(false);
});
}
- Пытался добавить файл sql.ora, но при вставке/извлечении записей в базу данных Oracle выдается ошибка ORA-06550. файл sql.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=11
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
Ниже приведена ошибка при попытке получить записи.
Oracle.ManagedDataAccess.Client.OracleConfiguration.HandleSet(Hashtable theParams, String propName, String paramName, Object value, Boolean checknull, Boolean fromJsonConfig)
at Oracle.ManagedDataAccess.Client.OracleConfiguration.set_SqlNetAllowedLogonVersionClient(OracleAllowedLogonVersionClient value)
at Common.Context.OracleDBContext.OnConfiguring(DbContextOptionsBuilder optionsBuilder)
at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
at Microsoft.EntityFrameworkCore.DbContext.get_Model()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at Repositories.SampleRepository.GetLines(String number) in /opt/atlassian/pipelines/agent/build/Repositories/SampleRepository.cs:line 93
- Пытался добавить следующее, но при попытке получить записи из БД Oracle.
OracleConfiguration.SqlNetAllowedLogonVersionClient = OracleAllowedLogonVersionClient.Version11;
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... to-8-23-40