Made transaction management work even before the first SQL query.
Thanks Florian again.
This commit is contained in:
parent
7c46c8d5f2
commit
09ba70f9f1
|
@ -269,6 +269,8 @@ class BaseDatabaseWrapper(object):
|
||||||
"""
|
"""
|
||||||
self.validate_no_atomic_block()
|
self.validate_no_atomic_block()
|
||||||
|
|
||||||
|
self.ensure_connection()
|
||||||
|
|
||||||
self.transaction_state.append(managed)
|
self.transaction_state.append(managed)
|
||||||
|
|
||||||
if not managed and self.is_dirty() and not forced:
|
if not managed and self.is_dirty() and not forced:
|
||||||
|
@ -286,6 +288,8 @@ class BaseDatabaseWrapper(object):
|
||||||
"""
|
"""
|
||||||
self.validate_no_atomic_block()
|
self.validate_no_atomic_block()
|
||||||
|
|
||||||
|
self.ensure_connection()
|
||||||
|
|
||||||
if self.transaction_state:
|
if self.transaction_state:
|
||||||
del self.transaction_state[-1]
|
del self.transaction_state[-1]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue