Database Polling

I am about to write a windows service that is going to poll the database every predefined minutes, it will look at a schedule table, decide if anything is due to execute then add it to the execution table.

What is the best way to achieve this, the config file would allow the user to change the time period, am I better spawning a new thread each time just in case it is set for 1 minute.

Any other advice would be helpful.

rocky050371Asked:
Who is Participating?
 
CodeCruiserCommented:
Even with an interval of one minute, you should be fine. But you can also force an interval value which is greater than or equal to say 5 minutes.
0
 
mcs0506Commented:
0
 
CodeCruiserCommented:
Do you have to poll? Look into SqlDependency class

http://www.codeproject.com/KB/database/chatter.aspx
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
rocky050371Author Commented:
the problem I need to calculate based on the schedule when a task is next due to execute.
0
 
CodeCruiserCommented:
Is that the polling schedule or the schedule of actual execution?
0
 
rocky050371Author Commented:
Each task has a schedule of when to execute, I will be checking the schedule constantly, if it is due I will be add a record to the execution table then updating the schedule next due date
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.