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 emad
26●29●29●31
any news about this bug?
Hello Ahmad, could you provide your model types definition as well? We were unable to reproduce your problem with this description.
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
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.
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
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.