Click here to Skip to main content
11,412,833 members (77,034 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# MySQL database
Hi folks!

I have a table within a mySQL database, which contains a list of tasks which have to be done by several windows services. The table TASKS contains a task ID field, a target ID field and a status field (running, waiting). The target ID points to the table TASKDETAILS which contains the details what to do exactly.

Now I have several windows services on different machines, which shall look into the TASKS table, grab an item setting the status from waiting (default) to running and execute whatever there is to do. The services are not aware of each other, there is no synchronization between them. It is also not possible to set up a manager service, where the services could grab a task from without checking the database.

I could imagine that in some kind of situations, a task could be taken by two services at the same time... I read something about synchronized lists in database but I'm not sure whether this approach is the best / right one. Locking the table could be another option.

Anyone done something similar before?

Thanks in advance

Rowan
Posted 15-Dec-12 0:44am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 379
1 Sascha Lefévre 200
2 Maciej Los 150
3 ProgramFOX 130
4 Sergey Alexandrovich Kryukov 110
0 Sergey Alexandrovich Kryukov 9,025
1 OriginalGriff 7,317
2 Maciej Los 3,570
3 Abhinav S 3,298
4 Peter Leow 3,084


Advertise | Privacy | Mobile
Web03 | 2.8.150427.1 | Last Updated 15 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100