def abort(self): """ Aborts the transaction. @return: None """ self.txn.abort() BaseTransaction.abort(self)
def abort(self): """ Aborts the transaction. @return: None """ self._close_cursors() self.txn.abort() BaseTransaction.abort(self)
def commit(self): """ Commits the transaction. @return: None """ while self._cursors: self._cursors[0].close() self.txn.commit() BaseTransaction.commit(self)
def __init__(self, env, nosync=False, snapshot=False, flags=0): self.env = env self._flags = flags if snapshot: self._flags |= db.DB_TXN_SNAPSHOT if nosync: self._flags |= db.DB_TXN_NOSYNC self._cursors = [] self.txn = env.txn_begin(None, self._flags) BaseTransaction.__init__(self)
def commit(self): """ Commits the transaction. @return: None """ try: self.txn.commit() except (db.DBLockDeadlockError, db.DBLockNotGrantedError): raise exceptions.DBTransactionIncomplete BaseTransaction.commit(self)
def _retry(self): self._cursors = [] self.txn = self.env.txn_begin(None, self._flags) BaseTransaction._retry(self)
def _retry(self): self.txn = self.env.txn_begin(None, db.DB_TXN_NOWAIT) BaseTransaction._retry(self)
def __init__(self, env): self.env = env self.txn = env.txn_begin(None, db.DB_TXN_NOWAIT) BaseTransaction.__init__(self)