From cc4db2c83ebf9c4a46eb64ccd103a5ce9853424a Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 7 Jul 2006 19:01:59 +0000 Subject: [PATCH] r10975: 07 Jul 2006 Kevin Rosenberg * Version 3.6.3 * sql/transactions.lisp: Important typo fix from Alexey Antipov for database-start-transaction --- ChangeLog | 5 +++++ debian/changelog | 6 ++++++ sql/transaction.lisp | 14 +++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11c2918..be823f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +07 Jul 2006 Kevin Rosenberg + * Version 3.6.3 + * sql/transactions.lisp: Important typo fix from Alexey Antipov + for database-start-transaction + 04 Jul 2006 Kevin Rosenberg * Version 3.6.2 * db-postgresql/postgresql-sql.lisp: Apply patch from Vladimir Sekissov diff --git a/debian/changelog b/debian/changelog index 08f508e..5181d0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-sql (3.6.3-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Fri, 7 Jul 2006 13:00:59 -0600 + cl-sql (3.6.2-1) unstable; urgency=low * New upstream diff --git a/sql/transaction.lisp b/sql/transaction.lisp index a9df87f..13fcd7c 100644 --- a/sql/transaction.lisp +++ b/sql/transaction.lisp @@ -22,7 +22,7 @@ (status :initform nil :accessor transaction-status :documentation "nil or :committed"))) -(defun add-transaction-commit-hook (commit-hook &key +(defun add-transaction-commit-hook (commit-hook &key (database *default-database*)) "Adds COMMIT-HOOK, which should a designator for a function with no required arguments, to the list of hooks run when COMMIT @@ -30,7 +30,7 @@ is called on DATABASE which defaults to *DEFAULT-DATABASE*." (when (transaction database) (push commit-hook (commit-hooks (transaction database))))) -(defun add-transaction-rollback-hook (rollback-hook +(defun add-transaction-rollback-hook (rollback-hook &key (database *default-database*)) "Adds ROLLBACK-HOOK, which should a designator for a function with no required arguments, to the list of hooks run when ROLLBACK @@ -40,11 +40,11 @@ is called on DATABASE which defaults to *DEFAULT-DATABASE*." (defmethod database-start-transaction ((database database)) (unless (transaction database) - (setf (transaction database) + (setf (transaction database) (make-instance 'transaction :previous-autocommit (database-autocommit database)))) (setf (database-autocommit database) nil) - (when (= (incf (transaction-level database) 1)) + (when (= (incf (transaction-level database)) 1) (let ((transaction (transaction database))) (setf (commit-hooks transaction) nil (rollback-hooks transaction) nil @@ -70,7 +70,7 @@ is called on DATABASE which defaults to *DEFAULT-DATABASE*." (with-slots (transaction transaction-level autocommit) database (if (plusp transaction-level) (when (zerop (decf transaction-level)) - (unwind-protect + (unwind-protect (execute-command "ROLLBACK" :database database) (setf autocommit (previous-autocommit transaction)) (map nil #'funcall (rollback-hooks transaction)))) @@ -106,14 +106,14 @@ back and otherwise the transaction is committed." currently within the scope of a transaction, commits changes made since the transaction began." (database-commit-transaction database) - nil) + nil) (defun rollback (&key (database *default-database*)) "If DATABASE, which defaults to *DEFAULT-DATABASE*, is currently within the scope of a transaction, rolls back changes made since the transaction began." (database-abort-transaction database) - nil) + nil) (defun start-transaction (&key (database *default-database*)) "Starts a transaction block on DATABASE which defaults to -- 2.34.1