Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does the select_for_update() QuerySet method do?

  1. A Selects rows for the next migration
  2. B Locks the selected rows until the end of the transaction
  3. C Marks rows as modified
  4. D Updates rows immediately
Answer

Locks the selected rows until the end of the transaction

It issues SELECT ... FOR UPDATE, preventing concurrent modification. It must be used inside an atomic block or Django raises an error.

All Django MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as