0

I start developing a Django web app that ist going to be used by hundreds of user at the same time.

The app consits of a simple database table that lists unique tasks top-down. The first user that request some tasks should get the tasks from the top of the list. The next user that asks for tasks should get the next tasks and so on.

How do I prevent, that users get the same tasks from the table when they ask for datasets at the same time? Is there the possibility of a race condition?

1
  • Please post your code so that we can give a context specific answer. It makes a difference. Thanks. Commented Oct 27, 2022 at 22:00

1 Answer 1

2

Try select_for_update or F expressions you can find more info here

F Expression

select_for_update

also I think this question might help

Sign up to request clarification or add additional context in comments.

2 Comments

You should expand on this answer
Thanks for the answer. select_for_update should do the trick.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.