def get(self): """See `~transaction.interfaces.ITransactionManager`.""" if self._txn is None: if self.explicit: raise NoTransaction() self._txn = Transaction(self._synchs, self) return self._txn
def begin(self): """ See ITransactionManager. """ if self._txn is not None: self._txn.abort() txn = self._txn = Transaction(self._synchs, self) _new_transaction(txn, self._synchs) return txn
def get(self): """ See ITransactionManager. """ if self._txn is None: if self.explicit: raise NoTransaction() self._txn = Transaction(self._synchs, self) return self._txn
def begin(self): """See `~transaction.interfaces.ITransactionManager`.""" if self._txn is not None: if self.explicit: raise AlreadyInTransaction() self._txn.abort() txn = self._txn = Transaction(self._synchs, self) _new_transaction(txn, self._synchs) return txn
def get(self): tid = thread.get_ident() txn = self._txns.get(tid) if txn is None: synchs = self._synchs.get(tid) if synchs is None: synchs = self._synchs[tid] = WeakSet() txn = self._txns[tid] = Transaction(synchs, self) return txn
def get(self): tid = thread.get_ident() txn = self._txns.get(tid) if txn is None: synchs = self._synchs.get(tid) if synchs is None: from ZODB.utils import WeakSet synchs = self._synchs[tid] = WeakSet() if self._global_syncs: [synchs.add(gs) for gs in self._global_syncs] txn = self._txns[tid] = Transaction(synchs, self) return txn
def begin(self): tid = thread.get_ident() txn = self._txns.get(tid) if txn is not None: txn.abort() synchs = self._synchs.get(tid) if synchs is None: synchs = self._synchs[tid] = WeakSet() txn = self._txns[tid] = Transaction(synchs, self) _new_transaction(txn, synchs) return txn
def begin(self): tid = thread.get_ident() txn = self._txns.get(tid) if txn is not None: txn.abort() synchs = self._synchs.get(tid) if synchs is None: from ZODB.utils import WeakSet synchs = self._synchs[tid] = WeakSet() if self._global_syncs: [synchs.add(gs) for gs in self._global_syncs] txn = self._txns[tid] = Transaction(synchs, self) _new_transaction(txn, synchs) return txn
def get(self): """ See ITransactionManager. """ if self._txn is None: self._txn = Transaction(self._synchs, self) return self._txn
def test_free_w_other_txn(self): from transaction._transaction import Transaction tm = self._makeOne() txn = Transaction() tm.begin() self.assertRaises(ValueError, tm.free, txn)
def get(self): if self._txn is None: self._txn = Transaction(self._synchs, self) return self._txn
def begin(self): if self._txn is not None: self._txn.abort() txn = self._txn = Transaction(self._synchs, self) _new_transaction(txn, self._synchs) return txn