SQL-Command: wrong table name [6.80.350.0]

SQL-Command: wrong table name [6.80.350.0]

Postby aldar » Thu 22 Nov 2012 14:59

Hi all,
i get from time to time a strange error while using two independent data context.
If each data context makes an insert into different tables, one context can generate a statement with table name from another context. The error is quite hard to reproduce.
We use dotConnect 6.80.350.0, Oracle 11gR2, .Net 4.0

Here an example for such statement, generated in the case of the error.

Code: Select all
BEGIN
INSERT INTO ATTRIBUTES(STO_ID, ATT_ID, VAL_STO_ID, TEXT, CHANGESEQUENCE, CREATIONTIME, CREATIONUSER, CHANGETIME, CHANGEUSER)
VALUES (:p0, :p1, :p2, NULL, :p3, :p4, :p5, NULL, NULL);
INSERT INTO ICC_SOURCE_VALS(STO_ID, ATT_ID, VAL_STO_ID, TEXT, CHANGESEQUENCE, CREATIONTIME, CREATIONUSER, CHANGETIME, CHANGEUSER)
VALUES (:p6, :p7, NULL, :p8, :p9, :p10, :p11, NULL, NULL);
INSERT INTO ATTRIBUTES(STO_ID, ATT_ID, VAL_STO_ID, TEXT, CHANGESEQUENCE, CREATIONTIME, CREATIONUSER, CHANGETIME, CHANGEUSER)
VALUES (:p12, :p13, :p14, NULL, :p15, :p16, :p17, NULL, NULL);
INSERT INTO ATTRIBUTES(STO_ID, ATT_ID, VAL_STO_ID, TEXT, CHANGESEQUENCE, CREATIONTIME, CREATIONUSER, CHANGETIME, CHANGEUSER)
VALUES (:p18, :p19, :p20, NULL, :p21, :p22, :p23, NULL, NULL);
INSERT INTO ATTRIBUTES(STO_ID, ATT_ID, VAL_STO_ID, TEXT, CHANGESEQUENCE, CREATIONTIME, CREATIONUSER, CHANGETIME, CHANGEUSER)
VALUES (:p24, :p25, :p26, NULL, :p27, :p28, :p29, NULL, NULL);
INSERT INTO ATTRIBUTES(STO_ID, ATT_ID, VAL_STO_ID, TEXT, CHANGESEQUENCE, CREATIONTIME, CREATIONUSER, CHANGETIME, CHANGEUSER)
VALUES (:p30, :p31, :p32, NULL, :p33, :p34, :p35, NULL, NULL);
END;


The second insert statement uses the table name (ICC_SOURCE_VALS) from second data context, but column-names from ATTRIBUTE-table, wich is a part of the first data context!
(The result of the execution is an ORA-00904 exception because of wrong column-names).

How can it be?
here is also the stack-trace for the given error:

Code: Select all
   at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
   at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
   at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
   at System.Data.Objects.ObjectContext.SaveChanges()
   at Prisma.RIA.ServerCore.SM.StructureManager.CreateStructureObject(StructureObject obj, StructureDimensionPoint parent) in C:\svn\DAR\App\Prisma.RIA\Prisma.RIA.ServerCore\SM\StructureManager.cs:line 213
   at Prisma.RIA.ServerCore.SM.StructureObjectFactory.CreateStructureObject(StructureObjectInfo stoInfo, IEnumerable`1 atbs) in C:\svn\DAR\App\Prisma.RIA\Prisma.RIA.ServerCore\SM\StructureObjectFactory.cs:line 314
   at Prisma.RIA.ServerCore.IM.InterfaceManager.InsertOrUpdateStructure(String versionName, InterfaceManagerRecord item) in C:\svn\DAR\App\Prisma.RIA\Prisma.RIA.ServerCore\IM\InterfaceManager.cs:line 295
   at Prisma.RIA.ServerCore.IM.InterfaceManager.ProcessRecord(String versionName, String format, InterfaceManagerRecord item) in C:\svn\DAR\App\Prisma.RIA\Prisma.RIA.ServerCore\IM\InterfaceManager.cs:line 312 System.Data.UpdateException
   at Devart.Data.Oracle.a7.b(Int32 A_0)
   at Devart.Data.Oracle.a9.d(Int32 A_0)
   at Devart.Data.Oracle.a9.a(Int32 A_0, bw A_1)
   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.OracleCommand.ExecuteNonQuery()
   at Devart.Common.Entity.aq.j()
   at Devart.Common.Entity.aq.i()
   at Devart.Common.Entity.aj.c()
   at Devart.Common.Entity.t.h()
   at Devart.Common.Entity.ca.b(DbConnectionBase A_0)
   at Devart.Common.Entity.ae.a()
   at Devart.Common.Entity.ae.b(CommandBehavior A_0)
   at Devart.Data.Oracle.Entity.e.b(CommandBehavior A_0)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
   at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) Devart.Data.Oracle.OracleException


Thank you!

Aldar.
aldar
 
Posts: 1
Joined: Thu 22 Nov 2012 14:37

Re: SQL-Command: wrong table name [6.80.350.0]

Postby Shalex » Fri 23 Nov 2012 15:46

We have never encountered such behaviour.

Please try to localize the problem and create a test project (with which the issue persists intermittently at least). If this cannot be done, give us as much information as possible: all EF options and their values, as we see you turned on the batch updates (is this correct?), etc.
Shalex
Devart Team
 
Posts: 7614
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle