X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Ftransaction.lisp;h=be3e6d8fdd15c2694299b991036734d09690e189;hp=201d7c015b63b1b5663d5c92b955a84678c42c26;hb=cb683851a0af33e88b7c4995435dc0cf226f6cba;hpb=44cd3f817f6f59ffe495db4cf2b9ea4637a57f75 diff --git a/sql/transaction.lisp b/sql/transaction.lisp index 201d7c0..be3e6d8 100644 --- a/sql/transaction.lisp +++ b/sql/transaction.lisp @@ -52,9 +52,9 @@ (setf autocommit (previous-autocommit transaction)) (map nil #'funcall (commit-hooks transaction))) (warn 'sql-warning - :format-control - "Cannot commit transaction against ~A because there is no transaction in progress." - :format-arguments (list database))))) + :message + (format nil "Cannot commit transaction against ~A because there is no transaction in progress." + database))))) (defmethod database-abort-transaction ((database database)) (with-slots (transaction transaction-level autocommit) database @@ -65,9 +65,9 @@ (setf autocommit (previous-autocommit transaction)) (map nil #'funcall (rollback-hooks transaction)))) (warn 'sql-warning - :format-control - "Cannot abort transaction against ~A because there is no transaction in progress." - :format-arguments (list database))))) + :message + (format nil "Cannot abort transaction against ~A because there is no transaction in progress." + database))))) (defun mark-transaction-committed (database) (when (and (transaction database) @@ -82,9 +82,10 @@ back and otherwise the transaction is committed." (let ((db (gensym "db-"))) `(let ((,db ,database)) (unwind-protect - (progn + (prog2 (database-start-transaction ,db) - ,@body + (progn + ,@body) (mark-transaction-committed ,db)) (if (eq (transaction-status (transaction ,db)) :committed) (database-commit-transaction ,db)