Hi,

I got a strange exception in Persistent type :

System.Reflection.TargetInvocationException occurred
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
       at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
       at Xtensive.Storage.Persistent.GetProperty[T](String fieldName)
       at Xtensive.Storage.Persistent.get_Item(String name)

  InnerException: System.NullReferenceException
       Message=Object reference not set to an instance of an object.
       Source=Xtensive.Storage
       StackTrace:
            at Xtensive.Storage.Internals.FieldAccessors.DefaultFieldAccessor`1.GetValue(Persistent obj)
            at Xtensive.Storage.Persistent.GetFieldValue[T](FieldInfo field)
            at Xtensive.Storage.Persistent.GetFieldValue[T](String fieldName)
            at MyBusinessObject.get_Rate() in

The original call is like this :

Xtensive.Storage.Model.FieldInfo fieldInfo;
      Persistent targetObject = GetTargetFromFieldName(entity, fieldName, out fieldInfo);
      return targetObject[fieldInfo.OriginalName];

Any idea?

I'm unable to reproduce this (it only happened one time)

Regards, Julien


Updated at 09.07.2010 8:21:19

I'm not sure : this object should not be removed in our application.

I was debugging the process at the time : could it be that Visual Studio called a property getter on a wrong thread for debug view and broke the current session? That would explain why I'm not able to reproduce this.

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Jul 07 '10 at 13:37

olorin's gravatar image

olorin
358878792

Calling from wrong thread won't lead to this issue: Session will be simply activated & deactivated there. So there must be something different.

(Jul 07 '10 at 13:37) Alex Yakunin Alex%20Yakunin's gravatar image

Possibly, it's a result of call of this method on removed object.

We must check this.

(Jul 07 '10 at 13:37) Alex Yakunin Alex%20Yakunin'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

powered by OSQA