Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thread Timing Problem

Status
Not open for further replies.

Nosh

Programmer
Jul 12, 2001
34
GB
Hi,

I have a thread that is timed to run every five minutes.
The thread picks up a database record set based on a processed indicator and sends a message to another system for each row.

What would happen if the activity the thread was doing lasted for more than five minutes and another thread licked off? Potentially we could send the same message twice if the record was being processed by the previous thread.

Is there a way of telling if there is a version of a thread running before kicking off another thread?

Cheers
Nosh.
 
ThreadGroups could be helpful there, but I just lock the appropriate rows in the db (select for update does it). Can you do that until the thread has finished sending the message?
 
I think you could be right - I'll give it a go.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top