r1905: removed with-db-from-pool
authorMarc Battyani <marc.battyani@fractalconcept.com>
Sat, 4 May 2002 16:21:27 +0000 (16:21 +0000)
committerMarc Battyani <marc.battyani@fractalconcept.com>
Sat, 4 May 2002 16:21:27 +0000 (16:21 +0000)
with-database now works with the pool

ChangeLog
sql/pool.cl

index 3813416e55efe66ad3caef46f88151c97098fdef..99cf1dd50820b437412964a6c6bf7710903d1cfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+04 May 2002 Marc Battyani (marc.battyani@fractalconcept.com)
+       * sql/sql.cl:
+       * sql/pool.cl:
+       * sql/functional.cl:
+       Added pool support in connect/disconnect and with-database.
+       Removed with-db-from-pool as with-database can now works with the connections pool
+
 01 May 2002 Marc Battyani (marc.battyani@fractalconcept.com)
        * sql/sql.cl:
        * sql/pool.cl:
index 9e94deab90fe9390ef32ae2ca46cfe1cd91b40de..6468c56047efb68fd7335f679b913fca82065569 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmers:   Kevin M. Rosenberg, Marc Battyani
 ;;;; Date Started:  Apr 2002
 ;;;;
-;;;; $Id: pool.cl,v 1.4 2002/05/03 20:50:18 marc.battyani Exp $
+;;;; $Id: pool.cl,v 1.5 2002/05/04 16:21:27 marc.battyani Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
   (when clear (clrhash *db-pool*))
   t)
 
-;;; with-db-from-pool is the macro you should use if you want to use pooled connections.
-;;; You can use it with a connection spec and database type or directly with a conn-pool.
-;;; When you give a conn-pool the connection spec and database type are ignored
-
-(defmacro with-db-from-pool ((db-var connection-spec database-type &optional conn-pool) &body body)
-  "Evaluate the body in an environment, where `db-var' is bound to a
-database connection acquired from the connection pool
-The connection is automatically released to the connection pool on exit from the body.
-If a pool is given then the connection-spec database-type are ignored."
-  `(let ((,db-var (acquire-from-pool ,connection-spec ,database-type ,conn-pool)))
-     (unwind-protect
-         (let ((,db-var ,db-var)) ,@body)
-       (release-to-pool ,db-var))))