views:

294

answers:

2

I am using SQL Express 2008 as a backend for a web application, the problem is the web application is used during business hours so sometimes during lunch or break time when there is no users logged in for a 20 minute period SQL express will kick into idle mode and free its cache.

I am aware of this because it logs something like: Server resumed execution after being idle 9709 seconds or Starting up database 'xxxxxxx' in the event log

I would like to avoid this idle behavior, is there anyway to configure SQL express to stop idling or at least widen the time window to longer than 20mins. Or is my only option to write a service that polls the db every 15mins to keep it spooled up ?

After reading articles like this it doesn't look to promising but maybe there is a hack or registry setting someone knows about.

+1  A: 

That behavior is not configurable.

You do have to implement a method to poll the database every so often. Also, like the article you linked to said, set the AUTO CLOSE property to false.

Chris Lively
A: 

Write a thread that does a simple query every few minutes. Start the thread in your global.asax Application_Start and you should be done!

routeNpingme