self.__transaction = None
def _autorollback(self):
- if not self.in_transaction():
- self._rollback_impl()
+ if not self._root.in_transaction():
+ self._root._rollback_impl()
def close(self):
"""Close this :class:`.Connection`.
finally:
connection.close()
+ def test_branch_autorollback(self):
+ connection = testing.db.connect()
+ try:
+ branched = connection.connect()
+ branched.execute(users.insert(), user_id=1, user_name='user1')
+ try:
+ branched.execute(users.insert(), user_id=1, user_name='user1')
+ except exc.DBAPIError:
+ pass
+ finally:
+ connection.close()
+
def test_branch_orig_rollback(self):
connection = testing.db.connect()
try: