Linq2Umbraco cached DataContext stays empty after import/refresh
I am using Linq2Umbraco in my project togther with a nightly import of new product items.
To gain a performance improvement I used the Cached DataContext as is described in other posts on this forum and in Aaron Powells video about caching.
I encounter strange behavior that I can't seem to resolve.
I start my site with a clean cache and no product items. Then I start the import, which imports and publishes a lot of imported product items. When the import is finished, I clear the DataContext cache-key. However, the next time when I request product items from the DataContext, a new DataContext object is created, added to the cache and returned. However, this newly created DataContext doesn't contain the newly imported product items (the umbraco.config file is updated before a new DataContext object is created) and since the DataContext is cached I never see my newly imported product items on the website.
The only way I seem to get the newly imported product items in the DataContext is when I restart the website.
Anyone any ideas? (I think I'm overlooking something simple but can't seem to figure it out...)
Linq2Umbraco cached DataContext stays empty after import/refresh
I am using Linq2Umbraco in my project togther with a nightly import of new product items.
To gain a performance improvement I used the Cached DataContext as is described in other posts on this forum and in Aaron Powells video about caching.
I encounter strange behavior that I can't seem to resolve.
I start my site with a clean cache and no product items. Then I start the import, which imports and publishes a lot of imported product items. When the import is finished, I clear the DataContext cache-key. However, the next time when I request product items from the DataContext, a new DataContext object is created, added to the cache and returned.
However, this newly created DataContext doesn't contain the newly imported product items (the umbraco.config file is updated before a new DataContext object is created) and since the DataContext is cached I never see my newly imported product items on the website.
The only way I seem to get the newly imported product items in the DataContext is when I restart the website.
Anyone any ideas? (I think I'm overlooking something simple but can't seem to figure it out...)
is working on a reply...