in reply to Re^2: 'flock' with multiple users
in thread 'flock' with multiple users
If you already have a database, why bother with locks?
Oracle offers various methods for making sure that processes don't step on each others feet. Usually, you want to do stuff in a transaction.
For example an easy way could be to UPDATE all rows that you will be processing with your PID, and then select all those that you got:
update top 10 jobs set processed_by = ? where processed_by is null order by job_id ; select * from jobs where processed_by = ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: 'flock' with multiple users
by Anonymous Monk on Sep 08, 2017 at 16:24 UTC | |
by davido (Cardinal) on Sep 08, 2017 at 16:44 UTC | |
|
Re^4: 'flock' with multiple users
by TheloniusMonk (Sexton) on Jul 30, 2020 at 13:24 UTC | |
by Corion (Patriarch) on Jul 30, 2020 at 13:28 UTC |