dotConnect 9.0.7 - Insert is broken (Devart.Data.Oracle.OracleException: ORA-01036: illegal variable name/number)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
BGrojer
Posts: 18
Joined: Thu 19 Sep 2013 12:35

dotConnect 9.0.7 - Insert is broken (Devart.Data.Oracle.OracleException: ORA-01036: illegal variable name/number)

Post by BGrojer » Tue 26 Apr 2016 13:55

Hi

EntityFramework Context SaveChanges() leads to an exception (Oracle 12c, .NET 4.6.1).

System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Devart.Data.Oracle.OracleException: ORA-01036: illegal variable name/number
at Devart.Data.Oracle.l.b(cc[] A_0, Byte[] A_1, Hashtable A_2)
at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Data.Oracle.Entity.m.a(CommandBehavior A_0)
at Devart.Data.Oracle.Entity.m.b(CommandBehavior A_0)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
at System.Data.Entity.Internal.InternalContext.SaveChanges()
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.SaveChanges()

Generated (broken) SqlCode:
DECLARE
updatedRowid ROWID;
BEGIN
INSERT INTO P_XXX(VERSION,HIERARCHYLASTMODIFIEDAT,UNIQUEID,ABC,REVIEWED,"COMMENT")VALUES(:p0,:p1,:p2,:p3,:p4,NULL)
RETURNING ROWID INTO updatedRowid;
OPEN ::outParameter FOR SELECT ID FROM P_XXX WHERE ROWID = updatedRowid;
END;

If activating
OracleEntityProviderConfig.Instance.DmlOptions.ParametersAsLiterals = true;
another exception is thrown. Looks like the parameters created \ used by you guys are broken.

System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.EntityCommandCompilationException: An error occurred while preparing the command definition. See the inner exception for details. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at Devart.Common.Entity.dy.a(n A_0, n A_1)
at Devart.Common.Entity.e3.a(fj A_0, DbCommand A_1)
at Devart.Common.Entity.eo.a(fj A_0, DbCommandBase A_1)
at Devart.Common.Entity.eo.c()
at Devart.Data.Oracle.Entity.OracleEntityProviderServices.CreateDbCommandDefinition(DbProviderManifest baseProviderManifest, DbCommandTree commandTree)
at System.Data.Entity.Core.Common.DbProviderServices.CreateCommand(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
--- End of inner exception stack trace ---
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(Dictionary`2 identifierValues)
at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
at System.Data.Entity.Internal.InternalContext.SaveChanges()

Thanks.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect 9.0.7 - Insert is broken (Devart.Data.Oracle.OracleException: ORA-01036: illegal variable name/number)

Post by Shalex » Wed 27 Apr 2016 14:52

We have reproduced the issue with identity properties. We will notify you when it is fixed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect 9.0.7 - Insert is broken (Devart.Data.Oracle.OracleException: ORA-01036: illegal variable name/number)

Post by Shalex » Fri 29 Apr 2016 11:31

The bug with generating INSERT statements for the tables with identity column is fixed. We will notify you when the corresponding build of dotConnect for Oracle is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotConnect 9.0.7 - Insert is broken (Devart.Data.Oracle.OracleException: ORA-01036: illegal variable name/number)

Post by Shalex » Fri 06 May 2016 08:17

New build of dotConnect for Oracle 9.0.12 is available for download now: http://forums.devart.com/viewtopic.php?f=1&t=33635.

Post Reply