November Happy Hour will be moved to Thursday December 5th.

NewsFeed Attachments randomly fails

Vote:
 

Having problems getting attachments from actors. The same actor randomly fails, somtimes it works and sometimes not.

var actor = EPiServer.Community.NewsFeed.NewsFeedHandler.Instance.GetStoryActor.GetStoryActor(int id);
var attachments = actor.Attachments;

    

Could it be that lazy loading or the cache is failing from time to time?
The problem always arises when IIS is restarted, that is fails on the first request after the restart, but works on the second requeset,
but fails again randomly after that.

 

Object reference not set to an instance of an object.

[NullReferenceException: Object reference not set to an instance of an object.]
EPiServer.Community.NewsFeed.Data.NewsFeedFactory.ConstructEPiServerCommunityEntity(DbDataReader reader) +91
EPiServer.Community.NewsFeed.Data.<>c__DisplayClass13.<GetStoryActorAttachments>b__12() +169
EPiServer.Data.Providers.<>c__DisplayClassa.<Execute>b__9() +14
EPiServer.Data.Providers.<>c__DisplayClass1`1.<Execute>b__0() +55
EPiServer.Data.Providers.SqlDeadlockRetryPolicy.Execute(Boolean isInTransaction, Func`1 method) +125
EPiServer.Community.NewsFeed.Data.NewsFeedFactory.GetStoryActorAttachments(NewsFeedStoryActor actor) +222

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Delegate.DynamicInvokeImpl(Object[] args) +106
EPiServer.Common.Cache.CacheHandler.GetCachedObjectImplementation(Delegate cacheObjectGetter, Object[] getterArgs, Nullable`1 cacheTimeSpan, NotFoundInCacheAnnouncer notFoundInCacheAnnouncer, String[] key) +561
EPiServer.Common.Cache.CacheHandler.GetCachedObject(Delegate cacheObjectGetter, Object[] getterArgs, String[] key) +74
EPiServer.Community.NewsFeed.NewsFeedHandler.GetStoryActorAttachments(NewsFeedStoryActor actor) +266

 

#80550
Jan 24, 2014 14:13
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.