Replies: 1 comment 4 replies
-
@jtkech thanks for that info. What I don't understand is that I am using Session directly without the contentManager. I simply query the content items, then alter some parts (the process may take 20 seconds before the alter take place). Then, I save it directly to the session. I think the background task will create a new session every time it runs since I am retrieving an ISeasion instance from the IoC container. I will send you the code I was referring to on Element/gitter. Lets me know your thoughts |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@sebastienros @MikeAlhayek
Just saw one of the last meeting where you talked about reloading an item (after a long process) before saving.
From memory IContentManagerSession only prevent to do a query to YesSql, so clearing it may not be sufficient because the YesSql ISession has its own cache.
So one solution would be to use
ShellScope.UsingChildScopeAsync()
to be under a new ISession, but the simplest way (if it fixes your issue) would be to useISession.Detach()
, we use it here.OrchardCore/src/OrchardCore/OrchardCore.Data.YesSql/Documents/DocumentStore.cs
Lines 73 to 76 in 72d717f
Beta Was this translation helpful? Give feedback.
All reactions