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/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/oneclickcos/mainapp/decorators.py", line 26, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/transaction.py", line 209, in inner
    return func(*args, **kwargs)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/transaction.py", line 203, in __exit__
    self.exiting(exc_value, self.using)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/transaction.py", line 288, in exiting
    leave_transaction_management(using=using)
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/transaction.py", line 52, in leave_transaction_management
    connection.leave_transaction_management()
  File "/home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/django/db/backends/__init__.py", 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 django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment