;;;;
;;;; Copyright (c) 1999-2001 Pierre R. Mai
;;;;
-;;;; $Id: functional.cl,v 1.2 2002/05/03 18:17:50 kevin Exp $
+;;;; $Id: functional.cl,v 1.3 2002/05/03 20:50:18 marc.battyani Exp $
;;;;
;;;; This file is part of CLSQL.
;;;;
&body body)
"Evaluate the body in an environment, where `db-var' is bound to the
database connection given by `connection-spec' and `connect-args'.
-The connection is automatically closed on exit from the body."
- `(let ((,db-var (connect ,connection-spec :pool pool
- :database-type database-type :if-exists if-exists)))
+If pool is t the the connection will be taken from the general pool,
+if pool is a conn-pool object the connection will be taken from this pool.
+The connection is automatically closed or released to the pool
+on exit from the body."
+ `(let ((,db-var (connect ,connection-spec :pool ,pool
+ :database-type ,database-type :if-exists ,if-exists)))
(unwind-protect
(let ((,db-var ,db-var)) ,@body)
- (disconnect :database ,db-var :pool pool))))
+ (disconnect :database ,db-var))))