1
0
mirror of https://github.com/django/django.git synced 2025-10-29 08:36:09 +00:00

Added some assertions to enforce the atomicity of atomic.

This commit is contained in:
Aymeric Augustin
2013-03-04 23:26:31 +01:00
parent d7bc4fbc94
commit 7c46c8d5f2
14 changed files with 369 additions and 279 deletions

View File

@@ -70,6 +70,7 @@ signals.request_started.connect(reset_queries)
# their lifetime. NB: abort() doesn't do anything outside of a transaction.
def close_old_connections(**kwargs):
for conn in connections.all():
# Remove this when the legacy transaction management goes away.
try:
conn.abort()
except DatabaseError: