Inserting data with 2 Primary keys

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
pinkgorilla
Posts: 3
Joined: Fri 02 Oct 2009 19:09

Inserting data with 2 Primary keys

Post by pinkgorilla » Fri 02 Oct 2009 21:00

hi, i have a problem when inserting with a data to an oracle table having 2 primary keys.
i'm using Entity Developer for dotConnect to generate Devart LINQ to SQL Model. and Visual Studio 2008

here's my case:

the table:

-----------------------
MyTable
-----------------------
pk1 varchar2(50) //primary key
pk2 varchar2(50) //primary key
Content CLOB
Data BLOB

----------------
the code:
----------------
MyTableDataContext _context = new MyTableDataContext();
MyTable _entity = new MyTable();
_entity.pk1 = "key1";
_entity.pk2 = "key2";

//i do not give value to the other fields and i don't think thats the cause for the problem i have

_context.MyTables.InsertOnSubmit(_entity);
_context.SubmitChanges();


now after i run the code, i get an exception of System.InvalidOperationException : Sequence contains no matching element on _context.MyTables.InsertOnSubmit(_entity);


i wonder what is wrong with my code? the code runs perfectly with tables with 1 primary key.

anyone could help?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 05 Oct 2009 13:40

I have tried to reproduce the problem using the latest 5.25.44 build of dotConnect for Oracle and failed.
What is the full version of dotConnect for Oracle you are using?
Also, please post the call stack of the error here.

pinkgorilla
Posts: 3
Joined: Fri 02 Oct 2009 19:09

Post by pinkgorilla » Tue 06 Oct 2009 04:43

hello AndreyR, here's the stack trace produced by the Exception:

Code: Select all

   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Devart.Data.Linq.MultiKeyManager`2.a()
   at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)
   at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)
   at Devart.Data.Linq.MultiKeyManager`2.CreateDefault[TType]()
   at Devart.Data.Linq.MultiKeyManager`2.CreateKeyFromInstance(T obj)
   at Devart.Data.Linq.KeyManager`2.a(Object A_0)
   at Devart.Data.Linq.Table`1.a(Object A_0, MetaType A_1)
   at Devart.Data.Linq.Table`1.b(Object A_0, MetaType A_1, Dictionary`2 A_2)
   at Devart.Data.Linq.Table`1.c(Object A_0, MetaType A_1)
   at Devart.Data.Linq.Table`1.InsertOnSubmit(TEntity entity)
   at _Default.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\Tris\My Documents\Visual Studio 2008\WebSites\LintasArta.Humanis\Default.aspx.cs:line 25
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
and i'm using dotConnect for Oracle version 5.25.39

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 07 Oct 2009 07:38

I recommend you to update to the latest 5.25.44 build of dotConnect for Oracle.

motuzko
Posts: 54
Joined: Tue 08 Sep 2009 18:02
Contact:

Post by motuzko » Fri 30 Oct 2009 15:25

Have same issue using 5.25.49
The worst thing is that it works on one box and does not work on the other

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 30 Oct 2009 15:59

First, are the call stacks from this and the previous case identical?
Also I recommend you to check that the versions of our LINQ assemblies are latest ones
(you can check it in the Modules window (Debug->Windows->Modules)).

Post Reply