Transactions don't work as per the documentation
|Reported by:||KayEss||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The documentation here http://www.djangoproject.com/documentation/transactions/ describes features of the transaction management, but there appears to be a fault which causes transactions not be managed correctly.
The following code should result in no database changes (the type of object created is not important - it can be anything).
from django.db import transaction from django.http import HttpResponseRedirect from bmf.core.models import * @transaction.commit_on_success def company_fail(request): ct = CompanyType() ct.name = "Charity" ct.save() raise ValueError, 'Do not carry this out'
Executed as a view it raises an error page as expected, but the new CompanyType instance is still added to the database.
Using postgres 8.3 & psycopg 2-2.0.6 on Windows.