Coverage report: /home/ati/workspace/perec/persistence/transaction.lisp
Both branches taken
One branch taken
Neither branch taken
;; -*- mode: Lisp; Syntax: Common-Lisp; -*-
;;; Copyright (c) 2006 by the authors.
;;; See LICENCE for details.
;;; with-database, open-database, close-database, with-transaction, with-transaction*, begin, commit, rollback are all inherited from cl-rdbms
(defun transaction-of (object)
"Returns the transaction to which the object is currently attached to or nil if the object is not known to be part of any ongoing transaction."
(awhen (slot-value object 'transaction)
(defun (setf transaction-of) (transaction object)
"Attaches the object to a different transaction."
(assert (or (not transaction)
(not (transaction-of object))))
(setf (slot-value object 'transaction)
(defun instance-in-transaction-p (object)
"Returns true iff the object is attached to a transaction which is in progress."
(awhen (transaction-of object)
(defun instance-in-current-transaction-p (object)
"Returns true iff the object is attached to the current transaction which is in progress."
(eq (transaction-of object) *transaction*)))