Skip to content

Setting CELERY_ALWAYS_EAGER=True leads to TransactionManagementError#4

Open
smlz wants to merge 1 commit intobradleyayers:masterfrom
atizo:master
Open

Setting CELERY_ALWAYS_EAGER=True leads to TransactionManagementError#4
smlz wants to merge 1 commit intobradleyayers:masterfrom
atizo:master

Conversation

@smlz
Copy link
Copy Markdown

@smlz smlz commented Aug 23, 2012

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

@ivirabyan
Copy link
Copy Markdown

Need this fix too

@zbyte64
Copy link
Copy Markdown

zbyte64 commented Dec 12, 2012

I too have this same issue.

@izquierdo
Copy link
Copy Markdown

Me too.

@nyaruka
Copy link
Copy Markdown

nyaruka commented Apr 24, 2013

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

@funkaoshi
Copy link
Copy Markdown

Same. Is this a dead project?

@tomplayford
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants