Click here to Skip to main content
15,891,828 members

windows services and task table within database

RowanArkison asked:

Open original thread
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
Tags: C#, MySQL, Database Development (MySQL)

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900