Note that there are some explanatory texts on larger screens.

plurals
  1. POSQLServer OutputCache objects deleted or not created
    primarykey
    data
    text
    <p>In this project I'm using MVC-3, with output cache attributes and the appropriate references in the web.config and, hopefully, the global.asax (below). I'm running production from a shared hosting and can't run aspnet_regsql as a admin to create the appropriate objects, so I copied the AspNet_SqlCacheTablesForChangeNotification table, the SPs and triggers up from my dev box to setup the database. </p> <p>In general, everything works great, however I'm finding that about once every 2 or 3 days all of the caching database objects are deleted and not getting recreated on app start. (no hosting co script is deleting them). </p> <p>To get the site working again, I end up manually copying the database objects back up. </p> <p>How can I not have the objects deleted, or, alternatively, have them automatically created?</p> <p>My app start in the global.asax looks like this:</p> <pre><code>protected void Application_Start() { RegisterGlobalFilters(GlobalFilters.Filters); SqlCacheDependencyAdmin.EnableNotifications(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString); SqlCacheDependencyAdmin.EnableTableForNotifications(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString, "be_Posts"); SqlCacheDependencyAdmin.EnableTableForNotifications(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString, "be_PostTag"); SiteMap.Provider.SiteMapResolve += new SiteMapResolveEventHandler(SiteMapPathExpansionResolver.OnSiteMapResolve); RegisterRoutes(RouteTable.Routes); } </code></pre> <p>and my app end looks like this:</p> <pre><code>protected void Application_End() { SqlCacheDependencyAdmin.DisableTableForNotifications(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString, "be_Posts"); SqlCacheDependencyAdmin.DisableTableForNotifications(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString, "be_PostTag"); SqlCacheDependencyAdmin.DisableNotifications(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString); } </code></pre> <p>web.config entry looks like this:</p> <pre><code>&lt;caching&gt; &lt;sqlCacheDependency enabled="true" pollTime="10000" &gt; &lt;databases&gt; &lt;add name=" db" connectionStringName="ApplicationServices" pollTime="10000" /&gt; &lt;/databases&gt; &lt;/sqlCacheDependency&gt; &lt;/caching&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload