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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcs0506Commented:
0
CodeCruiserCommented:
Do you have to poll? Look into SqlDependency class

http://www.codeproject.com/KB/database/chatter.aspx
0
rocky050371Author Commented:
the problem I need to calculate based on the schedule when a task is next due to execute.
0
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.