columns joined by a "group" to load as "undeferred".
- sql
+ - added context manager (with statement) support for transactions
- added support for two phase commit, works with mysql and postgres so far.
- added a subtransaction implementation that uses savepoints.
- added support for savepoints.
def _do_commit(self):
pass
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, traceback):
+ if type is None and self._is_active:
+ self.commit()
+ else:
+ self.rollback()
+
class RootTransaction(Transaction):
def __init__(self, connection):
super(RootTransaction, self).__init__(connection, None)