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

Why should a Celery task be dispatched using transaction.on_commit()?

  1. A To improve throughput
  2. B Because the worker may otherwise query a row before the transaction has committed
  3. C To reduce memory usage
  4. D Because tasks cannot run inside transactions
Answer

Because the worker may otherwise query a row before the transaction has committed

Dispatching inside an open transaction creates a race where the worker looks up an object that is not yet visible, producing intermittent failures.

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