C
Chris Gallucci
I need help with what I think may be a design issue.
I need to access a record for processing. I need to do it in such a fashion that several concurrent processes do not access the same
record.
I've set up a stored procedure that first queries the table for a record to process than marks the record so that it is now
unavailable.
The process that executes this stored procedure runs on multiple threads on multiple machines.
My problem is that I have occasions where two or more threads access the same record at the same time which causes unwanted
redundant processing. IOW, I need to be able to guarantee that a record will never be processed by more than a single thread of
execution.
Does anyone have a solution or suggestion? Is there a design pattern for this?
FWIW, the parent process is a Windows Service written in C#.NET (v1.1) running against a SQL Server 2000 database.
ChrisG
I need to access a record for processing. I need to do it in such a fashion that several concurrent processes do not access the same
record.
I've set up a stored procedure that first queries the table for a record to process than marks the record so that it is now
unavailable.
The process that executes this stored procedure runs on multiple threads on multiple machines.
My problem is that I have occasions where two or more threads access the same record at the same time which causes unwanted
redundant processing. IOW, I need to be able to guarantee that a record will never be processed by more than a single thread of
execution.
Does anyone have a solution or suggestion? Is there a design pattern for this?
FWIW, the parent process is a Windows Service written in C#.NET (v1.1) running against a SQL Server 2000 database.
ChrisG