Permalink
Browse files

Made transaction management work even before the first SQL query.

Thanks Florian again.
  • Loading branch information...
1 parent 7c46c8d commit 09ba70f9f1844680ac0e0b3a7c38ff7113cbdb02 @aaugustin aaugustin committed Mar 5, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/db/backends/__init__.py
View
4 django/db/backends/__init__.py
@@ -269,6 +269,8 @@ def enter_transaction_management(self, managed=True, forced=False):
"""
self.validate_no_atomic_block()
+ self.ensure_connection()
+
self.transaction_state.append(managed)
if not managed and self.is_dirty() and not forced:
@@ -286,6 +288,8 @@ def leave_transaction_management(self):
"""
self.validate_no_atomic_block()
+ self.ensure_connection()
+
if self.transaction_state:
del self.transaction_state[-1]
else:

0 comments on commit 09ba70f

Please sign in to comment.