Friday, March 30, 2012

How to debug transaction management errors?

I have a view which is causing the error that follows. I understand what it means, but I am *certain* there is no way that my code should be causing this error (Every single return is prefaced with either transaction.commit() or transaction.rollback()).

Is there a good way to debug this error?

2012-03-30 12:37:11,163 ERROR Internal Server Error: /incorporate/
Traceback (most recent call last):
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/core/handlers/", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/oneclickcos/mainapp/", line 26, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/", line 209, in inner
    return func(*args, **kwargs)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/", line 203, in __exit__
    self.exiting(exc_value, self.using)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/", line 288, in exiting
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/", line 52, in leave_transaction_management
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/backends/", line 119, in leave_transaction_management
    raise TransactionManagementError("Transaction managed block ended with "
TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK

Marcin Tustin
Tel: 07773 787 105

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment