How do you guys handle the model context in the SF backend?
SF Devs...
Are you using a PerRequestScope and disposing on Unload or App End?....or in each method are you creating and disposing the context object?
Steve
Hi Steve,
We keep data for the IObjectScope in HttpContext.Items and dispose them in SitefinityHttpModule - Context_EndRequest. Each provider is created in a different object scope when you work directly with managers ( say PageManager, TaxonomyManager etc). When you create an instance of the default manager by uising GetManager method if the manager type is the same, this will not create a new object scope.
When you work with fluent API and create an instance of multiple managers (say PageManager, TaxonomyManager etc) they will work in the same IObjectScope.
If your data is coming from different databases this creates a new IObjectScope for each manager.
_PageManager.GetManager("LocalProvider");
_PageManager.GetManager("RemoteProvider");
Sincerely yours,
Ivan Dimitrov
the Telerik team