Answer the question
In order to leave comments, you need to log in
How to do write lock in postgresql sequelize?
Hello, there is a table with records, the records have statuses, 1 and 2 (free and busy). And the cron runs the code, which should take one free record with the free status, and change it to the busy status. And due to the fact that this happens at the same time, one entry gets into the crown in several cycles, and when the status changes to busy, an error occurs that the entry was not found.
How can I make a record lock, or update only one record, with the status free?
Answer the question
In order to leave comments, you need to log in
See select for update. Although I did not understand why there is competition if the launch is by krone.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question