#12565: PostgresSQL does not rollback transactions from database errors.
------------------------------------------+---------------------------------
Reporter: abhik | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.1
Keywords: transaction rollback | Stage: Unreviewed
Has_patch: 0 |
------------------------------------------+---------------------------------
When I decorate a function with @transaction.commit_on_success and an
IntegrityError is thrown inside it, the transaction is not closed. I would
expect it to rollback.
For instance, if I have a model with a unique_together constraint and
violate that constraint in the function an IntegrityError is thrown. When
I catch the IntegrityError outside the function and try to execute a
select, PostgresSQL complains. From some initial debugging, is_dirty in
the transaction module is not True for the function, so nothing is done to
the transaction.
--
Ticket URL: <http://code.djangoproject.com/ticket/12565>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.