Commit Graph

9 Commits

Author SHA1 Message Date
Malcolm Tredinnick 260510453f Fixed #7241 -- More robust exception catching in the transaction management
code. As pointed out in the ticket, Python still lets you raise all sorts of
odd things as exceptions (e.g. strings), so even though they're bad form, we
should still handle them. We do that cleanly now. Thanks to jim-django@dsdd.org
for the patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8419 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-17 00:07:06 +00:00
Malcolm Tredinnick 3eb8074808 Added savepoint protection to get_or_create() to avoid problems on PostgreSQL.
Fixed #7402.

Also made savepoint handling easier to use when wrapped around calls that might
commit a transaction. This is tested by the get_or_create tests.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8315 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 05:59:43 +00:00
Malcolm Tredinnick 220993bcc5 Added savepoint support to the transaction code.
This is a no-op for most databases. Only necessary on PostgreSQL so that we can
do things which will possibly intentionally raise an IntegrityError and not
have to rollback the entire transaction. Not supported for PostgreSQL versions
prior to 8.0, so should be used sparingly in internal Django code.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 05:34:56 +00:00
Malcolm Tredinnick 52b6857f93 Fixed #6928 -- Added a little more robustness to transaction rollbacks for Python 2.5. Patch from guettli.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 11:56:52 +00:00
Russell Keith-Magee 8a0b8d93b2 Fixed #7286 -- Added functools wrapping to the transaction decorators. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7558 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-05-29 11:50:50 +00:00
Malcolm Tredinnick 439cb4047f Fixed #4040 -- Changed uses of has_key() to "in". Slight performance
improvement and forward-compatible with future Python releases. Patch from Gary
Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-26 13:30:48 +00:00
Adrian Holovaty 72307a6eee Fixed typo in docstring in db/transaction.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3135 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-16 19:35:57 +00:00
Adrian Holovaty 56131d0fb9 Fixed #2052 -- Fixed some threading issues for FreeBSD. Thanks, scott@clued-in.co.uk
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 04:57:10 +00:00
Adrian Holovaty f69cf70ed8 MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02 01:31:56 +00:00