Your Ad Here

Monday, January 16, 2012

Transaction commited byt still receiving "Transaction managed block ended with pending COMMIT/ROLLBACK"

Hello,

This is the view (minimal version without POST processing block):

@transaction.commit_manually()
def create_free(request):
context = {};
context['categories'] = Category.objects.all()
transaction.commit()
return render_to_response(
'advert/create_free.html',
context,
RequestContext(request)
)

But I still get "Transaction managed block ended with pending
COMMIT/ROLLBACK" exception. This is caused by the Category model load (due
to lazy QuerySet that is evaluated in template processing?). If yes, I
will have to render_to_string and then commit, right?

Thanks,
Martin

--
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.

0 comments:

Post a Comment