django-celery-transactions icon indicating copy to clipboard operation
django-celery-transactions copied to clipboard

Setting CELERY_ALWAYS_EAGER=True leads to TransactionManagementError

Open smlz opened this issue 12 years ago • 6 comments

Auto-commit synchronously executed tasks when CELERY_ALWAYS_EAGER is set to True.

When CELERY_ALWAYS_EAGER is set, tasks are executed synchronously in the same VM. Writing to the database in a such a djcelery_transactions.task, will then raise a TransactionManagementError, as the modifications are not automatically commited to the database.

[...]
  File "/home/marco/workspace/atizo-platform-env-python2.6/src/django/django/db/backends/__init__.py", line 115, in leave_transaction_management
    raise TransactionManagementError("Transaction managed block ended with "

TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK

smlz avatar Aug 23 '12 10:08 smlz

Need this fix too

ivirabyan avatar Sep 07 '12 09:09 ivirabyan

I too have this same issue.

zbyte64 avatar Dec 12 '12 18:12 zbyte64

Me too.

izquierdo avatar Mar 13 '13 01:03 izquierdo

Me three.. kind of a requirement when doing automated tests using ALWAYS_EAGER

nyaruka avatar Apr 24 '13 12:04 nyaruka

Same. Is this a dead project?

funkaoshi avatar May 07 '13 22:05 funkaoshi

We've been having trouble applying this patch to latest HEAD, so I thought I'd share.

The below works for us - but use at your own risk.

https://github.com/10to8/django-celery-transactions

tomplayford avatar May 21 '13 10:05 tomplayford