Hello, I have an entity named "Bank", which contains entityset of "BankBranch". the bank branch also contains an entityset of "BankAccount". when try to remove Bank (or BankBranch or BankAccount) i got an "Object reference not set to an instance of an object." exception with the following stack trace:

at Xtensive.Orm.Providers.SessionHandler.BuildReferencingQuery(AssociationInfo association)
   at Xtensive.Orm.Providers.SessionHandler.<GetReferencesTo>b__0(Object p)
   at Xtensive.Collections.ThreadSafeDictionary`2.GetValue(TKey key, Func`2 generator)
   at Xtensive.Orm.Providers.SessionHandler.GetReferencesTo(Entity target, AssociationInfo association)
   at Xtensive.Orm.ReferenceFinder.GetReferencesTo(Entity target, AssociationInfo association)
   at Xtensive.Orm.ReferentialIntegrity.RemovalProcessor.ProcessItems(IList`1 entities)
   at Xtensive.Orm.ReferentialIntegrity.RemovalProcessor.Remove(IEnumerable`1 entities)

asked Jan 01 '14 at 03:09

ahmad%20emad's gravatar image

ahmad emad

edited Jan 02 '14 at 00:12

any news about this bug?

(Mar 24 '14 at 06:07) ahmad emad ahmad%20emad's gravatar image

Hello Ahmad, could you provide your model types definition as well? We were unable to reproduce your problem with this description.

(Mar 24 '14 at 08:44) Denis Krjuchkov Denis%20Krjuchkov's gravatar image

Hello Denis, I have sent my model DLL and its dependencies to support@dataobjects.net. the bug also occur on Dataobject 4.3.3, also The Model DLL is Microtech.Infinity5.Model and the Type that has the problem is Microtech.Infinity5.Model.Financial.GL.Bank

(Mar 27 '14 at 01:40) ahmad emad ahmad%20emad's gravatar image

Hello Ahmad, I've tried to contact you by e-mail but for some reason both my e-mails were rejected by spamcop. So here is our answer:

Unfortunately this is known issue. Exception is caused by PayableCheck structure referencing Bank entity. DO tries to find all objects referencing Bank entity to perform OnRemove actions, however currently we don't have the way fetch all entities that use specified structure.

Let us know if this is a critical issue for you, we'll try to find some workaround.

(Apr 07 '14 at 07:48) Denis Krjuchkov Denis%20Krjuchkov's gravatar image

Hello Denis, I find the structure "PayableCheque"(no PayableCheck found in the project) and found no use for it in the system, so i deleted it from the project, but the problem still exist, so is there are other structures that i have to deal with? i can try to do it manually till you find solution but i need to know the structures that cause the exception

(Apr 08 '14 at 08:14) ahmad emad ahmad%20emad's gravatar image

This problem affects any structure that references an entity. You can have such references in the model, but referenced entities can't be deleted. Simple workaround is to annotate such references with [Association(OnTargetRemove = OnRemoveAction.None)] but this disables any processing of the annotated reference fields which might be not convenient.

(Apr 09 '14 at 05:40) Denis Krjuchkov Denis%20Krjuchkov's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview


Once you sign in you will be able to subscribe for any updates here



Asked: Jan 01 '14 at 03:09

Seen: 1,379 times

Last updated: Apr 09 '14 at 05:40

powered by OSQA