Strange exception

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
listonic
Posts: 39
Joined: Mon 06 Dec 2010 15:47

Strange exception

Post by listonic » Tue 13 Dec 2011 19:02

After attaching entity to context and submiting i receive strange exception:


Exception :System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at Devart.Data.Linq.b.a(Object A_0, Object A_1, MetaType A_2)
at Devart.Data.Linq.s.a(k A_0, ae A_1, Object A_2, Boolean A_3)
at Devart.Data.Linq.n.a(s A_0, ae A_1, Boolean A_2)
at Devart.Data.Linq.n.a(DataContext A_0, ConflictMode A_1)
at Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
at Listonic.BLL.Logging.SuperBaseLinqDs`3.Submit() in D:\GitRepo\ListonicProd\Common\Listonic.BLL.Logging\SuperBaseLinqDs.cs:line 170
at Listonic.BLL.Logging.SuperBaseLinqDs`3.Update(T entity) in D:\GitRepo\ListonicProd\Common\Listonic.BLL.Logging\SuperBaseLinqDs.cs:line 139
at Listonic.Gazetki.GazetkiProcessorThreader.run() in D:\GitRepo\ListonicProd\Common\Listonic.Gazetki\GazetkiProcessorThreader.cs:line 77 Source :mscorlib

The problem is that when this operation is repeated for same record, there is no exception.

I have teh newest version of linq connect.

If it possible that you Can give more information about possible exception cause ?

Regards
Piotr Wójcicki

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 14 Dec 2011 16:40

Could you please describe the issue in more details? In particular, how exactly do you attach the entity to the context (e.g., execute the Table.InsertOnSubmit or Table.Attach method with this entity as a parameter, or set an entity navigation property to another object already attached to the context)? If possible, please send us a small project illustrating the issue.

At the moment, we couldn't reproduce the issue in our environment.

listonic
Posts: 39
Joined: Mon 06 Dec 2010 15:47

Post by listonic » Wed 14 Dec 2011 22:01

StanislavK wrote: At the moment, we couldn't reproduce the issue in our environment.
I was hoping that with the stack trace you would be able to point me in the right direction what is the possible problem.

Unfortunately the problem occurs randomly and i have no idea how to reproduce it.

I am ussing attach with flag indicating that record is modified.

I will try to deal with it by myself.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 15 Dec 2011 16:21

According to the stack trace, the problem may occur if the object you've attached is garbage-collected before submitting the changes. This should be possible if, e.g., you are working with POCO entities; however, we couldn't reproduce such a problem in our environment.

If you manage to reliably reproduce the error, please describe the situation in which it occurs, so that we are able to provide you more information about its possible reasons.

Post Reply