[elephant-cvs] CVS elephant/src/db-clsql

ieslick ieslick at common-lisp.net
Tue Feb 20 02:34:00 UTC 2007


Update of /project/elephant/cvsroot/elephant/src/db-clsql
In directory clnet:/tmp/cvs-serv7106a/db-clsql

Modified Files:
	sql-transaction.lisp 
Log Message:
Enable with-transaction to return multiple values in both backends

--- /project/elephant/cvsroot/elephant/src/db-clsql/sql-transaction.lisp	2007/02/02 23:51:58	1.4
+++ /project/elephant/cvsroot/elephant/src/db-clsql/sql-transaction.lisp	2007/02/20 02:33:59	1.5
@@ -31,10 +31,17 @@
       (funcall txn-fn)
       (progn
 	(clsql::set-autocommit nil)
-	(unwind-protect
-	     (clsql::with-transaction (:database (controller-db sc))
-	       (funcall txn-fn))
-	  (clsql::set-autocommit t)))))
+	(let ((db (controller-db sc)))
+	  (unwind-protect
+	       (multiple-value-prog1
+		   (progn
+		     (clsql-sys::database-start-transaction db)
+		     (funcall txn-fn))
+		 (clsql-sys::mark-transaction-committed db))
+	    (if (eq (clsql-sys::transaction-status (clsql-sys::transaction db)) :committed)
+		(clsql-sys::database-commit-transaction db)
+		(clsql-sys::database-abort-transaction db))
+	    (clsql::set-autocommit t))))))
 
 (defmethod controller-start-transaction ((sc sql-store-controller) &key &allow-other-keys)
   (clsql:start-transaction :database (controller-db sc))




More information about the Elephant-cvs mailing list