Hi,
I am working on a file processor that relies on the db to feed file records to different machines for processing.
The problem I am having is the same file record (row) is being sent to 2 different machines simultaneously.
In the db I have a "processing" column that flags the file record row as (Y/N). The app queries for file record rows = 'N' and updates the row's value to 'Y'.
However, since all machines can query the db, it's giving some the same file record (where processing = 'N') at once, canceling out the logic that prevents the machine from getting a file record that is "processing". It's as if the update is not fast enough or the row needs to be locked until the update/process is complete on it?
Is there a way to prevent the same record (row result) from being returned to more than one machine?
Thanks,
B
I am working on a file processor that relies on the db to feed file records to different machines for processing.
The problem I am having is the same file record (row) is being sent to 2 different machines simultaneously.
In the db I have a "processing" column that flags the file record row as (Y/N). The app queries for file record rows = 'N' and updates the row's value to 'Y'.
However, since all machines can query the db, it's giving some the same file record (where processing = 'N') at once, canceling out the logic that prevents the machine from getting a file record that is "processing". It's as if the update is not fast enough or the row needs to be locked until the update/process is complete on it?
Is there a way to prevent the same record (row result) from being returned to more than one machine?
Thanks,
B