Hi,
Looking for some advice. I need to develop a
Java application to:
- Query a database looking for new requests (request_status == 'New')
- When a 'New' request is found, instantiate a request object and pass it the request_params
- Update the database (request_status = "Processing")
- Sleep for 5 seconds
- Start entire process over
I think what I am looking for is generally referred to as a daemon. I searched Google for some examples, but cannot find a simple one that I understand -- Kinda new at this.
So, my questions are:
- Am I looking at the best practice for doing this (query, sleep, query, sleep...)?
- Can you give me advice on the best practice?
- Can you point me to an example of the best practice?