r1798: Initial support for pooled connections
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 27 Apr 2002 20:58:11 +0000 (20:58 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 27 Apr 2002 20:58:11 +0000 (20:58 +0000)
14 files changed:
ChangeLog
Makefile
VERSION
clsql.system
doc/Makefile
doc/ref.sgml
interfaces/mysql/mysql-sql.cl
interfaces/postgresql-socket/postgresql-socket-sql.cl
interfaces/postgresql/postgresql-sql.cl
sql/classes.cl
sql/db-interface.cl
sql/package.cl
sql/pool.cl [new file with mode: 0644]
sql/sql.cl

index b8b7f3d8c94833634ce4dd9794808a7c72611f6c..5c9411c8c09a0549db857ac79371b986733b92d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+23 Apr 2002 Kevin Rosenberg (kevin@rosenberg.net)
+       * Multiple files:
+       Added initial support for connection pool
+
 23 Apr 2002 Kevin Rosenberg (kevin@rosenberg.net)
        * interfaces/postgresql/postgresql-sql.cl:
        Fix keyword typo in database-read-large-object
 23 Apr 2002 Kevin Rosenberg (kevin@rosenberg.net)
        * interfaces/postgresql/postgresql-sql.cl:
        Fix keyword typo in database-read-large-object
index 01d6ee9f0a7cac74483d9e11b871e1f8c596cb5e..131c68940c3d9ded8bed94682a84dcd2d390e85c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 #  Programer:    Kevin M. Rosenberg
 #  Date Started: Mar 2002
 #
 #  Programer:    Kevin M. Rosenberg
 #  Date Started: Mar 2002
 #
-#  CVS Id:   $Id: Makefile,v 1.14 2002/04/23 21:32:25 kevin Exp $
+#  CVS Id:   $Id: Makefile,v 1.15 2002/04/27 20:58:11 kevin Exp $
 #
 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 #
 #
 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 #
@@ -17,19 +17,19 @@ PKG=clsql
 
 .PHONY: all libs clean distclean doc tagcvs dist wwwdist
 
 
 .PHONY: all libs clean distclean doc tagcvs dist wwwdist
 
-SUBDIRS=interfaces/mysql interfaces/clsql-uffi
-.PHONY: subdirs $(SUBDIRS)
+LIBSUBDIRS=interfaces/mysql interfaces/clsql-uffi
+.PHONY: subdirs $(LIBSUBDIRS)
 
 
-all: $(SUBDIRS)
+all: $(LIBSUBDIRS)
 
 
-$(SUBDIRS):
+$(LIBSUBDIRS):
        $(MAKE) -C $@
 
 clean:
        @rm -f $(PKG)-*.tar.gz $(PKG)-*.zip
        @find . -type d -name .bin |xargs rm -rf 
        @find . -type f -name "#*" -or -name \*~ -exec rm {} \;
        $(MAKE) -C $@
 
 clean:
        @rm -f $(PKG)-*.tar.gz $(PKG)-*.zip
        @find . -type d -name .bin |xargs rm -rf 
        @find . -type f -name "#*" -or -name \*~ -exec rm {} \;
-       @for i in $(SUBDIRS) ; do $(MAKE) -C $$i $@ ; done
+       @for i in $(LIBSUBDIRS) ; do $(MAKE) -C $$i $@ ; done
 
 distclean: clean
 
 
 distclean: clean
 
diff --git a/VERSION b/VERSION
index e83707c8895a0286c74d12e3d22496208366edc6..671a34cf759236f1b6691c80406b11e4d60ce9f2 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-0.6.8
+0.7.0
 
 
 
 
 
 
index 41ba9f24991289e7664a766d405233af547a54e2..82e6d53eac446625ecf936f8555a36c38c01c940 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: clsql.system,v 1.5 2002/04/01 05:27:55 kevin Exp $
+;;;; $Id: clsql.system,v 1.6 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -40,7 +40,8 @@
                 (:file "classes")
                 (:file "conditions" :depends-on ("classes"))
                 (:file "db-interface" :depends-on ("conditions"))
                 (:file "classes")
                 (:file "conditions" :depends-on ("classes"))
                 (:file "db-interface" :depends-on ("conditions"))
-                (:file "sql" :depends-on ("db-interface"))
+                (:file "pool" :depends-on ("db-interface"))
+                (:file "sql" :depends-on ("pool"))
                 (:file "utils" :depends-on ("package"))
                 (:file "functional" :depends-on ("sql"))
                 (:file "usql" :depends-on ("sql")))
                 (:file "utils" :depends-on ("package"))
                 (:file "functional" :depends-on ("sql"))
                 (:file "usql" :depends-on ("sql")))
index 85a9f0269aae7ddab6af7aafa4ee2e49d233e2ff..3b6f58495c793a0a2bd6dbe4e9192ec6269730a9 100644 (file)
@@ -5,7 +5,7 @@
 #  Programer:    Kevin M. Rosenberg
 #  Date Started: Mar 2002
 #
 #  Programer:    Kevin M. Rosenberg
 #  Date Started: Mar 2002
 #
-#  CVS Id:   $Id: Makefile,v 1.7 2002/04/23 21:32:25 kevin Exp $
+#  CVS Id:   $Id: Makefile,v 1.8 2002/04/27 20:58:11 kevin Exp $
 #
 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 #
 #
 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 #
@@ -95,7 +95,7 @@ clean:
        @rm -f ${PSFILE} ${PDFFILE} ${DVIFILE} ${TEXFILE}
        @rm -f ${TMPFILES}
 
        @rm -f ${PSFILE} ${PDFFILE} ${DVIFILE} ${TEXFILE}
        @rm -f ${TMPFILES}
 
-realclean: clean
-       @rm -f *~
+distclean: clean
+       @rm -f *~ .#* *.bak *.orig
 
 
 
 
index a24ae22b0d337952b4fba2c2af9f476c0c715c1d..89113a8c0e4f86e9d33cb8b483c74e99d868c163 100644 (file)
@@ -10,7 +10,7 @@
        &clsql;.</para>
     </partintro>
     <!-- Conditions -->
        &clsql;.</para>
     </partintro>
     <!-- Conditions -->
-    <refentry id="maisql-condition">
+    <refentry id="clsql-condition">
       <refnamediv>
        <refname>CLSQL-CONDITION</refname>
        <refpurpose>the super-type of all
       <refnamediv>
        <refname>CLSQL-CONDITION</refname>
        <refpurpose>the super-type of all
@@ -22,7 +22,7 @@
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
@@ -37,7 +37,7 @@
          initialization arguments nor any accessors.</para>
       </refsect1>
     </refentry>
          initialization arguments nor any accessors.</para>
       </refsect1>
     </refentry>
-    <refentry id="maisql-error">
+    <refentry id="clsql-error">
       <refnamediv>
        <refname>CLSQL-ERROR</refname>
        <refpurpose>the super-type of all
       <refnamediv>
        <refname>CLSQL-ERROR</refname>
        <refpurpose>the super-type of all
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
@@ -68,7 +68,7 @@
          initialization arguments nor any accessors.</para>
       </refsect1>
     </refentry>
          initialization arguments nor any accessors.</para>
       </refsect1>
     </refentry>
-    <refentry id="maisql-simple-error">
+    <refentry id="clsql-simple-error">
       <refnamediv>
        <refname>CLSQL-SIMPLE-ERROR</refname>
        <refpurpose>Unspecific simple
       <refnamediv>
        <refname>CLSQL-SIMPLE-ERROR</refname>
        <refpurpose>Unspecific simple
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-simple-error</errortype></member>
+         <member><errortype>clsql-simple-error</errortype></member>
          <member><errortype>simple-condition</errortype></member>
          <member><errortype>simple-condition</errortype></member>
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
@@ -99,7 +99,7 @@
          <errortype>simple-condition</errortype>.</para>
       </refsect1>
     </refentry>
          <errortype>simple-condition</errortype>.</para>
       </refsect1>
     </refentry>
-    <refentry id="maisql-warning">
+    <refentry id="clsql-warning">
       <refnamediv>
        <refname>CLSQL-WARNING</refname>
        <refpurpose>the super-type of all
       <refnamediv>
        <refname>CLSQL-WARNING</refname>
        <refpurpose>the super-type of all
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-warning</errortype></member>
+         <member><errortype>clsql-warning</errortype></member>
          <member><errortype>warning</errortype></member>
          <member><errortype>warning</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          initialization arguments nor any accessors.</para>
       </refsect1>
     </refentry>
          initialization arguments nor any accessors.</para>
       </refsect1>
     </refentry>
-    <refentry id="maisql-simple-warning">
+    <refentry id="clsql-simple-warning">
       <refnamediv>
        <refname>CLSQL-SIMPLE-WARNING</refname>
        <refpurpose>Unspecific simple
       <refnamediv>
        <refname>CLSQL-SIMPLE-WARNING</refname>
        <refpurpose>Unspecific simple
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-simple-warning</errortype></member>
+         <member><errortype>clsql-simple-warning</errortype></member>
          <member><errortype>simple-condition</errortype></member>
          <member><errortype>simple-condition</errortype></member>
-         <member><errortype>maisql-warning</errortype></member>
+         <member><errortype>clsql-warning</errortype></member>
          <member><errortype>warning</errortype></member>
          <member><errortype>warning</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
       </refsect1>
     </refentry>
     <!-- Specifc Conditions -->
       </refsect1>
     </refentry>
     <!-- Specifc Conditions -->
-    <refentry id="maisql-invalid-spec-error">
+    <refentry id="clsql-invalid-spec-error">
       <refnamediv>
        <refname>CLSQL-INVALID-SPEC-ERROR</refname>
        <refpurpose>condition representing errors because of invalid
       <refnamediv>
        <refname>CLSQL-INVALID-SPEC-ERROR</refname>
        <refpurpose>condition representing errors because of invalid
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-invalid-spec-error</errortype></member>
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-invalid-spec-error</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:connection-spec</symbol></seg>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:connection-spec</symbol></seg>
-           <seg><function>maisql-invalid-spec-error-connection-spec</function></seg>
+           <seg><function>clsql-invalid-spec-error-connection-spec</function></seg>
            <seg>The invalid connection specification used.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:database-type</symbol></seg>
            <seg>The invalid connection specification used.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:database-type</symbol></seg>
-           <seg><function>maisql-invalid-spec-error-database-type</function></seg>
+           <seg><function>clsql-invalid-spec-error-database-type</function></seg>
            <seg>The Database type used in the attempt.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:template</symbol></seg>
            <seg>The Database type used in the attempt.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:template</symbol></seg>
-           <seg><function>maisql-invalid-spec-error-template</function></seg>
+           <seg><function>clsql-invalid-spec-error-template</function></seg>
            <seg>An argument describing the template that a valid
              connection specification must match for this database type.</seg>
          </seglistitem>
        </segmentedlist>
       </refsect1>
     </refentry>
            <seg>An argument describing the template that a valid
              connection specification must match for this database type.</seg>
          </seglistitem>
        </segmentedlist>
       </refsect1>
     </refentry>
-    <refentry id="maisql-connect-error">
+    <refentry id="clsql-connect-error">
       <refnamediv>
        <refname>CLSQL-CONNECT-ERROR</refname>
        <refpurpose>condition representing errors during
       <refnamediv>
        <refname>CLSQL-CONNECT-ERROR</refname>
        <refpurpose>condition representing errors during
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-connect-error</errortype></member>
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-connect-error</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:database-type</symbol></seg>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:database-type</symbol></seg>
-           <seg><function>maisql-connect-error-database-type</function></seg>
+           <seg><function>clsql-connect-error-database-type</function></seg>
            <seg>Database type for the connection attempt</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:connection-spec</symbol></seg>
            <seg>Database type for the connection attempt</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:connection-spec</symbol></seg>
-           <seg><function>maisql-connect-error-connection-spec</function></seg>
+           <seg><function>clsql-connect-error-connection-spec</function></seg>
            <seg>The connection specification used in the
              connection attempt.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:errno</symbol></seg>
            <seg>The connection specification used in the
              connection attempt.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:errno</symbol></seg>
-           <seg><function>maisql-connect-error-errno</function></seg>
+           <seg><function>clsql-connect-error-errno</function></seg>
            <seg>The numeric or symbolic error specification
              returned by the database back-end.  The values and
              semantics of this are interface specific.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:error</symbol></seg>
            <seg>The numeric or symbolic error specification
              returned by the database back-end.  The values and
              semantics of this are interface specific.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:error</symbol></seg>
-           <seg><function>maisql-connect-error-error</function></seg>
+           <seg><function>clsql-connect-error-error</function></seg>
            <seg>A string describing the problem that occurred,
              possibly one returned by the database back-end.</seg>
          </seglistitem>
        </segmentedlist>
       </refsect1>
     </refentry>
            <seg>A string describing the problem that occurred,
              possibly one returned by the database back-end.</seg>
          </seglistitem>
        </segmentedlist>
       </refsect1>
     </refentry>
-    <refentry id="maisql-sql-error">
+    <refentry id="clsql-sql-error">
       <refnamediv>
        <refname>CLSQL-SQL-ERROR</refname>
        <refpurpose>condition representing errors during query or
       <refnamediv>
        <refname>CLSQL-SQL-ERROR</refname>
        <refpurpose>condition representing errors during query or
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-sql-error</errortype></member>
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-sql-error</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:database</symbol></seg>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:database</symbol></seg>
-           <seg><function>maisql-sql-error-database</function></seg>
+           <seg><function>clsql-sql-error-database</function></seg>
            <seg>The database object that was involved in the
              incident.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:expression</symbol></seg>
            <seg>The database object that was involved in the
              incident.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:expression</symbol></seg>
-           <seg><function>maisql-sql-error-expression</function></seg>
+           <seg><function>clsql-sql-error-expression</function></seg>
            <seg>The SQL expression whose execution caused the error.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:errno</symbol></seg>
            <seg>The SQL expression whose execution caused the error.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:errno</symbol></seg>
-           <seg><function>maisql-sql-error-errno</function></seg>
+           <seg><function>clsql-sql-error-errno</function></seg>
            <seg>The numeric or symbolic error specification
              returned by the database back-end.  The values and
              semantics of this are interface specific.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:error</symbol></seg>
            <seg>The numeric or symbolic error specification
              returned by the database back-end.  The values and
              semantics of this are interface specific.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:error</symbol></seg>
-           <seg><function>maisql-sql-error-error</function></seg>
+           <seg><function>clsql-sql-error-error</function></seg>
            <seg>A string describing the problem that occurred,
              possibly one returned by the database back-end.</seg>
          </seglistitem>
        </segmentedlist>
       </refsect1>
     </refentry>
            <seg>A string describing the problem that occurred,
              possibly one returned by the database back-end.</seg>
          </seglistitem>
        </segmentedlist>
       </refsect1>
     </refentry>
-    <refentry id="maisql-exists-condition">
+    <refentry id="clsql-exists-condition">
       <refnamediv>
        <refname>CLSQL-EXISTS-CONDITION</refname>
        <refpurpose>condition indicating situations arising because of 
       <refnamediv>
        <refname>CLSQL-EXISTS-CONDITION</refname>
        <refpurpose>condition indicating situations arising because of 
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-exists-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-exists-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <function>connect</function>, either a warning, an error or
          no condition at all is signalled.  If a warning or error is
          signalled, either
          <function>connect</function>, either a warning, an error or
          no condition at all is signalled.  If a warning or error is
          signalled, either
-         <errortype>maisql-exists-warning</errortype> or
-         <errortype>maisql-exists-error</errortype> is signalled,
+         <errortype>clsql-exists-warning</errortype> or
+         <errortype>clsql-exists-error</errortype> is signalled,
          which are subtypes of
          which are subtypes of
-         <errortype>maisql-exists-condition</errortype> and
-         <errortype>maisql-warning</errortype> or
-         <errortype>maisql-error</errortype>.
-         <errortype>maisql-exists-condition</errortype> is never
+         <errortype>clsql-exists-condition</errortype> and
+         <errortype>clsql-warning</errortype> or
+         <errortype>clsql-error</errortype>.
+         <errortype>clsql-exists-condition</errortype> is never
          signalled itself.</para>
        <para>
          The following initialization arguments and accessors exist:</para>
          signalled itself.</para>
        <para>
          The following initialization arguments and accessors exist:</para>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:old-db</symbol></seg>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:old-db</symbol></seg>
-           <seg><function>maisql-exists-condition-old-db</function></seg>
+           <seg><function>clsql-exists-condition-old-db</function></seg>
            <seg>The database object that represents the existing
              connection.  This slot is always filled.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:new-db</symbol></seg>
            <seg>The database object that represents the existing
              connection.  This slot is always filled.</seg>
          </seglistitem>
          <seglistitem>
            <seg><symbol>:new-db</symbol></seg>
-           <seg><function>maisql-exists-condition-new-db</function></seg>
+           <seg><function>clsql-exists-condition-new-db</function></seg>
            <seg>The database object that will be used and returned by 
              this call to connect, if execution continues normally.
              This can be either <symbol>nil</symbol>, indicating that 
            <seg>The database object that will be used and returned by 
              this call to connect, if execution continues normally.
              This can be either <symbol>nil</symbol>, indicating that 
        </segmentedlist>
       </refsect1>
     </refentry>
        </segmentedlist>
       </refsect1>
     </refentry>
-    <refentry id="maisql-exists-warning">
+    <refentry id="clsql-exists-warning">
       <refnamediv>
        <refname>CLSQL-EXISTS-WARNING</refname>
        <refpurpose>condition representing warnings arising because of 
       <refnamediv>
        <refname>CLSQL-EXISTS-WARNING</refname>
        <refpurpose>condition representing warnings arising because of 
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-exists-warning</errortype></member>
-         <member><errortype>maisql-exists-condition</errortype></member>
-         <member><errortype>maisql-warning</errortype></member>
+         <member><errortype>clsql-exists-warning</errortype></member>
+         <member><errortype>clsql-exists-condition</errortype></member>
+         <member><errortype>clsql-warning</errortype></member>
          <member><errortype>warning</errortype></member>
          <member><errortype>warning</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
       <refsect1>
        <title>Description</title>
        <para>This condition is a subtype of
       <refsect1>
        <title>Description</title>
        <para>This condition is a subtype of
-       <errortype>maisql-exists-condition</errortype>, and is
+       <errortype>clsql-exists-condition</errortype>, and is
          signalled during calls to <function>connect</function> when
          there is an existing connection, and
          <parameter>if-exists</parameter> is either
          signalled during calls to <function>connect</function> when
          there is an existing connection, and
          <parameter>if-exists</parameter> is either
          the existing old database object.</para>
        <para>
          The initialization arguments and accessors are the same as
          the existing old database object.</para>
        <para>
          The initialization arguments and accessors are the same as
-         for <errortype>maisql-exists-condition</errortype>.</para>
+         for <errortype>clsql-exists-condition</errortype>.</para>
       </refsect1>
     </refentry>
       </refsect1>
     </refentry>
-    <refentry id="maisql-exists-error">
+    <refentry id="clsql-exists-error">
       <refnamediv>
        <refname>CLSQL-EXISTS-ERROR</refname>
        <refpurpose>condition representing errors arising because of 
       <refnamediv>
        <refname>CLSQL-EXISTS-ERROR</refname>
        <refpurpose>condition representing errors arising because of 
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-exists-error</errortype></member>
-         <member><errortype>maisql-exists-condition</errortype></member>
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-exists-error</errortype></member>
+         <member><errortype>clsql-exists-condition</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
       <refsect1>
        <title>Description</title>
        <para>This condition is a subtype of
       <refsect1>
        <title>Description</title>
        <para>This condition is a subtype of
-       <errortype>maisql-exists-condition</errortype>, and is
+       <errortype>clsql-exists-condition</errortype>, and is
          signalled during calls to <function>connect</function> when
          there is an existing connection, and
          <parameter>if-exists</parameter> is <symbol>:error</symbol>.
          signalled during calls to <function>connect</function> when
          there is an existing connection, and
          <parameter>if-exists</parameter> is <symbol>:error</symbol>.
          action in continuing from this correctable error.</para>
        <para>
          The initialization arguments and accessors are the same as
          action in continuing from this correctable error.</para>
        <para>
          The initialization arguments and accessors are the same as
-         for <errortype>maisql-exists-condition</errortype>.</para>
+         for <errortype>clsql-exists-condition</errortype>.</para>
       </refsect1>
     </refentry>
       </refsect1>
     </refentry>
-    <refentry id="maisql-closed-error">
+    <refentry id="clsql-closed-error">
       <refnamediv>
        <refname>CLSQL-CLOSED-ERROR</refname>
        <refpurpose>condition representing errors because the database 
       <refnamediv>
        <refname>CLSQL-CLOSED-ERROR</refname>
        <refpurpose>condition representing errors because the database 
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
        <title>Class Precedence List</title>
         <para>
        <simplelist type="inline">
-         <member><errortype>maisql-closed-error</errortype></member>
-         <member><errortype>maisql-error</errortype></member>
+         <member><errortype>clsql-closed-error</errortype></member>
+         <member><errortype>clsql-error</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
          <member><errortype>error</errortype></member>
          <member><errortype>serious-condition</errortype></member>
-         <member><errortype>maisql-condition</errortype></member>
+         <member><errortype>clsql-condition</errortype></member>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <member><errortype>condition</errortype></member>
          <member><errortype>t</errortype></member>
        </simplelist>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:database</symbol></seg>
          <segtitle>Description</segtitle>
          <seglistitem>
            <seg><symbol>:database</symbol></seg>
-           <seg><function>maisql-closed-error-database</function></seg>
+           <seg><function>clsql-closed-error-database</function></seg>
            <seg>The database object that was involved in the
              incident.</seg>
          </seglistitem>
            <seg>The database object that was involved in the
              incident.</seg>
          </seglistitem>
          already present.</para>
        <para>If initialization fails, the function returns
          <symbol>nil</symbol>, and/or signals an error of type
          already present.</para>
        <para>If initialization fails, the function returns
          <symbol>nil</symbol>, and/or signals an error of type
-         <errortype>maisql-error</errortype>.  The kind of action
+         <errortype>clsql-error</errortype>.  The kind of action
          taken depends on the back-end and the cause of the
          problem.</para>
       </refsect1>
          taken depends on the back-end and the cause of the
          problem.</para>
       </refsect1>
        <title>Exceptional Situations</title>
        <para>If an error is encountered during the initialization
          attempt, the back-end may signal errors of kind
        <title>Exceptional Situations</title>
        <para>If an error is encountered during the initialization
          attempt, the back-end may signal errors of kind
-         <errortype>maisql-error</errortype>.</para>
+         <errortype>clsql-error</errortype>.</para>
       </refsect1>
       <refsect1>
        <title>See Also</title>
       </refsect1>
       <refsect1>
        <title>See Also</title>
          <function>disconnect</function>.  All functions and generic
          functions that take database objects as arguments will
          signal errors of type
          <function>disconnect</function>.  All functions and generic
          functions that take database objects as arguments will
          signal errors of type
-         <errortype>maisql-closed-error</errortype> when they are
+         <errortype>clsql-closed-error</errortype> when they are
          called on instances of <type>closed-database</type>, with
          the exception of <function>database-name</function>, which
          will continue to work as for instances of
          called on instances of <type>closed-database</type>, with
          the exception of <function>database-name</function>, which
          will continue to work as for instances of
          <parameter>database</parameter>.  If it succeeds, it returns 
          the first database found.</para>
        <para>If it fails to find a matching database, it will signal
          <parameter>database</parameter>.  If it succeeds, it returns 
          the first database found.</para>
        <para>If it fails to find a matching database, it will signal
-         an error of type <errortype>maisql-error</errortype> if
+         an error of type <errortype>clsql-error</errortype> if
          <parameter>errorp</parameter> is true.  If
          <parameter>errorp</parameter> is <symbol>nil</symbol>, it
          will return <symbol>nil</symbol> instead.</para>
          <parameter>errorp</parameter> is true.  If
          <parameter>errorp</parameter> is <symbol>nil</symbol>, it
          will return <symbol>nil</symbol> instead.</para>
       <refsect1>
        <title>Exceptional Situations</title>
        <para>Will signal an error of type
       <refsect1>
        <title>Exceptional Situations</title>
        <para>Will signal an error of type
-       <errortype>maisql-error</errortype> if no matching database
+       <errortype>clsql-error</errortype> if no matching database
          can be found, and <parameter>errorp</parameter> is true.
          Will signal an error if the value of
          <parameter>database</parameter> is neither an object of type
          can be found, and <parameter>errorp</parameter> is true.
          Will signal an error if the value of
          <parameter>database</parameter> is neither an object of type
        <para>None.</para>
       </refsect1>
     </refentry>
        <para>None.</para>
       </refsect1>
     </refentry>
+
     <refentry id="connect">
       <refnamediv>
        <refname>CONNECT</refname>
     <refentry id="connect">
       <refnamediv>
        <refname>CONNECT</refname>
       </refnamediv>
       <refsect1>
        <title>Syntax</title>
       </refnamediv>
       <refsect1>
        <title>Syntax</title>
-       <synopsis><function>connect</function> <replaceable>connection-spec</replaceable> &amp;key <replaceable>if-exists</replaceable> <replaceable>database-type</replaceable> => <returnvalue>database</returnvalue></synopsis>
+       <synopsis><function>connect</function> <replaceable>connection-spec</replaceable> &amp;key <replaceable>if-exists</replaceable> <replaceable>database-type</replaceable> <replaceable>pool</replaceable> => <returnvalue>database</returnvalue></synopsis>
       </refsect1>
       <refsect1>
        <title>Arguments and Values</title>
       </refsect1>
       <refsect1>
        <title>Arguments and Values</title>
                <symbol>*default-database-type*</symbol></para>
            </listitem>
          </varlistentry>
                <symbol>*default-database-type*</symbol></para>
            </listitem>
          </varlistentry>
+         <varlistentry>
+           <term><parameter>pool</parameter></term>
+           <listitem>
+             <para>A boolean flag. If &t;, acquire connection from a
+               pool of open connections. If the pool is empty, a new
+               connection is created. The default is &nil;.
+           </listitem>
+         </varlistentry>
          <varlistentry>
            <term><returnvalue>database</returnvalue></term>
            <listitem>
          <varlistentry>
            <term><returnvalue>database</returnvalue></term>
            <listitem>
              <listitem>
                <para>This is just like <symbol>:new</symbol>, but
                  also signals a warning of type
              <listitem>
                <para>This is just like <symbol>:new</symbol>, but
                  also signals a warning of type
-                 <errortype>maisql-exists-warning</errortype>,
+                 <errortype>clsql-exists-warning</errortype>,
                  indicating the old and newly created
                  databases.</para>
              </listitem>
                  indicating the old and newly created
                  databases.</para>
              </listitem>
              <listitem>
                <para>This will cause <function>connect</function> to
                  signal a correctable error of type
              <listitem>
                <para>This will cause <function>connect</function> to
                  signal a correctable error of type
-                 <errortype>maisql-exists-error</errortype>.  The
+                 <errortype>clsql-exists-error</errortype>.  The
                  user may choose to proceed, either by indicating
                  that a new connection shall be created, via the
                  restart <symbol>create-new</symbol>, or by
                  user may choose to proceed, either by indicating
                  that a new connection shall be created, via the
                  restart <symbol>create-new</symbol>, or by
              <listitem>
                <para>This is just like <symbol>:old</symbol>, but
                  also signals a warning of type
              <listitem>
                <para>This is just like <symbol>:old</symbol>, but
                  also signals a warning of type
-                 <errortype>maisql-exists-warning</errortype>,
+                 <errortype>clsql-exists-warning</errortype>,
                  indicating the old database used, via the slots
                  <symbol>old-db</symbol> and
                  <symbol>new-db</symbol></para>
                  indicating the old database used, via the slots
                  <symbol>old-db</symbol> and
                  <symbol>new-db</symbol></para>
        <title>Exceptional Situations</title>
        <para>If the connection specification is not syntactically or
          semantically correct for the given database type, an error
        <title>Exceptional Situations</title>
        <para>If the connection specification is not syntactically or
          semantically correct for the given database type, an error
-         of type <errortype>maisql-invalid-spec-error</errortype> is
+         of type <errortype>clsql-invalid-spec-error</errortype> is
          signalled.  If during the connection attempt an error is
          detected (e.g. because of permission problems, network
          trouble  or any other cause), an error of type
          signalled.  If during the connection attempt an error is
          detected (e.g. because of permission problems, network
          trouble  or any other cause), an error of type
-         <errortype>maisql-connect-error</errortype> is
+         <errortype>clsql-connect-error</errortype> is
          signalled.</para>
        <para>If a connection to the database specified by
          <parameter>connection-spec</parameter> exists already,
          signalled.</para>
        <para>If a connection to the database specified by
          <parameter>connection-spec</parameter> exists already,
        <para>None.</para>
       </refsect1>
     </refentry>
        <para>None.</para>
       </refsect1>
     </refentry>
+
     <refentry id="disconnect">
       <refnamediv>
        <refname>DISCONNECT</refname>
     <refentry id="disconnect">
       <refnamediv>
        <refname>DISCONNECT</refname>
       </refnamediv>
       <refsect1>
        <title>Syntax</title>
       </refnamediv>
       <refsect1>
        <title>Syntax</title>
-       <synopsis><function>disconnect</function> &amp;key <replaceable>database</replaceable> => <returnvalue>t</returnvalue></synopsis>
+       <synopsis><function>disconnect</function> &amp;key <replaceable>database</replaceable> <replaceable>pool</replaceable> => <returnvalue>t</returnvalue></synopsis>
       </refsect1>
       <refsect1>
        <title>Arguments and Values</title>
        <variablelist>
       </refsect1>
       <refsect1>
        <title>Arguments and Values</title>
        <variablelist>
+         <varlistentry>
+           <term><parameter>pool</parameter></term>
+           <listitem>
+             <para>A boolean flag indicating whether to put the database into a 
+pool of opened databases. If &t;, rather than terminating the database connection, the
+connection is left open and the connection is placed into a pool of connections. Subsequent
+calls to <link linkend="connect"><function>connect</function></link> can then reuse this connection.
+The default is &nil;.
+           </listitem>
+         </varlistentry>
          <varlistentry>
            <term><parameter>database</parameter></term>
            <listitem>
          <varlistentry>
            <term><parameter>database</parameter></term>
            <listitem>
          with the exception of <function>database-name</function>.
          If the user does pass a  closed database object to any other
          &clsql; function, an error of type
          with the exception of <function>database-name</function>.
          If the user does pass a  closed database object to any other
          &clsql; function, an error of type
-         <errortype>maisql-closed-error</errortype> is
+         <errortype>clsql-closed-error</errortype> is
          signalled.</para>
       </refsect1>
       <refsect1>
          signalled.</para>
       </refsect1>
       <refsect1>
        <title>Exceptional Situations</title>
        <para>If during the disconnection attempt an error is
          detected (e.g. because of network trouble or any other
        <title>Exceptional Situations</title>
        <para>If during the disconnection attempt an error is
          detected (e.g. because of network trouble or any other
-         cause), an error of type <errortype>maisql-error</errortype> 
+         cause), an error of type <errortype>clsql-error</errortype> 
+         might be signalled.</para>
+      </refsect1>
+      <refsect1>
+       <title>See Also</title>
+       <para>
+       <simplelist>
+         <member><link linkend="connect"><function>connect</function></link></member>
+         <member><link linkend="connect"><function>closed-database</function></link></member>
+       </simplelist>
+       </para>
+      </refsect1>
+      <refsect1>
+       <title>Notes</title>
+       <para>None.</para>
+      </refsect1>
+    </refentry>
+
+    <refentry id="disconnect-pooled">
+      <refnamediv>
+       <refname>DISCONNECT-POOLED</refname>
+       <refpurpose>closes all pooled database connections</refpurpose>
+       <refclass>Function</refclass>
+      </refnamediv>
+      <refsect1>
+       <title>Syntax</title>
+       <synopsis><function>disconnect-pool</function> => <returnvalue>t</returnvalue></synopsis>
+      </refsect1>
+      <refsect1>
+       <title>Description</title>
+       <para>This function disconnects all database connections
+       that have been placed into the pool. Connections are placed
+       in the pool by calling 
+       <link linkend="disconnect"><function>disconnection</function></link>.
+      </refsect1>
+      <refsect1>
+       <title>Examples</title>
+       <programlisting>
+(disconnect-pool)
+=> T
+       </programlisting>
+      </refsect1>
+      <refsect1>
+       <title>Side Effects</title>
+       <para>Database connections will be closed and entries in the pool are removed.
+      </refsect1>
+      <refsect1>
+       <title>Affected by</title>
+       <para>
+       <simplelist>
+         <member><function>disconnect</function></member>
+       </simplelist>
+       </para>
+      </refsect1>
+      <refsect1>
+       <title>Exceptional Situations</title>
+       <para>If during the disconnection attempt an error is
+         detected (e.g. because of network trouble or any other
+         cause), an error of type <errortype>clsql-error</errortype> 
          might be signalled.</para>
       </refsect1>
       <refsect1>
          might be signalled.</para>
       </refsect1>
       <refsect1>
        <para>None.</para>
       </refsect1>
     </refentry>
        <para>None.</para>
       </refsect1>
     </refentry>
+
     <refentry id="database-name-from-spec">
       <refnamediv>
        <refname>DATABASE-NAME-FROM-SPEC</refname>
     <refentry id="database-name-from-spec">
       <refnamediv>
        <refname>DATABASE-NAME-FROM-SPEC</refname>
        <para>If the value of <parameter>connection-spec</parameter>
          is not a valid connection specification for the given
          database type, an error of type
        <para>If the value of <parameter>connection-spec</parameter>
          is not a valid connection specification for the given
          database type, an error of type
-         <errortype>maisql-invalid-spec-error</errortype> might be
+         <errortype>clsql-invalid-spec-error</errortype> might be
          signalled.</para>
       </refsect1>
       <refsect1>
          signalled.</para>
       </refsect1>
       <refsect1>
          <parameter>sql-expression</parameter> in the
          <parameter>database</parameter> specified.  If the execution 
          succeeds it will return <symbol>t</symbol>, otherwise an
          <parameter>sql-expression</parameter> in the
          <parameter>database</parameter> specified.  If the execution 
          succeeds it will return <symbol>t</symbol>, otherwise an
-         error of type <errortype>maisql-sql-error</errortype> will
+         error of type <errortype>clsql-sql-error</errortype> will
          be signalled.</para>
       </refsect1>
       <refsect1>
          be signalled.</para>
       </refsect1>
       <refsect1>
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL statement leads to any
          errors, an error of type
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL statement leads to any
          errors, an error of type
-         <errortype>maisql-sql-error</errortype> is signalled.</para>
+         <errortype>clsql-sql-error</errortype> is signalled.</para>
       </refsect1>
       <refsect1>
        <title>See Also</title>
       </refsect1>
       <refsect1>
        <title>See Also</title>
          <parameter>database</parameter> specified.  If the execution 
          succeeds it will return the result set returned by the
          database, otherwise an error of type
          <parameter>database</parameter> specified.  If the execution 
          succeeds it will return the result set returned by the
          database, otherwise an error of type
-         <errortype>maisql-sql-error</errortype> will 
+         <errortype>clsql-sql-error</errortype> will 
          be signalled.</para>
       </refsect1>
       <refsect1>
          be signalled.</para>
       </refsect1>
       <refsect1>
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
-         <errortype>maisql-sql-error</errortype> is signalled.</para>
+         <errortype>clsql-sql-error</errortype> is signalled.</para>
       </refsect1>
       <refsect1>
        <title>See Also</title>
       </refsect1>
       <refsect1>
        <title>See Also</title>
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
-         <errortype>maisql-sql-error</errortype> is signalled.</para>
+         <errortype>clsql-sql-error</errortype> is signalled.</para>
        <para>An error of type <errortype>type-error</errortype> must
          be signaled if the <parameter>output-type-spec</parameter> is
          not a recognizable subtype of <type>list</type>, not a
        <para>An error of type <errortype>type-error</errortype> must
          be signaled if the <parameter>output-type-spec</parameter> is
          not a recognizable subtype of <type>list</type>, not a
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
-         <errortype>maisql-sql-error</errortype> is signalled.</para>
+         <errortype>clsql-sql-error</errortype> is signalled.</para>
        <para>If the number of variable names in
          <parameter>args</parameter> and the number of attributes in
          the tuples in the result set don't match up, an error is
        <para>If the number of variable names in
          <parameter>args</parameter> and the number of attributes in
          the tuples in the result set don't match up, an error is
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
        <title>Exceptional Situations</title>
        <para>If the execution of  the SQL query leads to any
          errors, an error of type
-         <errortype>maisql-sql-error</errortype> is signalled.</para>
+         <errortype>clsql-sql-error</errortype> is signalled.</para>
        <para>Otherwise, any of the exceptional situations of
          <function>loop</function> applies.</para>
       </refsect1>
        <para>Otherwise, any of the exceptional situations of
          <function>loop</function> applies.</para>
       </refsect1>
          initialization by returning <symbol>t</symbol> from their
          method, and <symbol>nil</symbol> otherwise.  Methods for
          this generic function are allowed to signal errors of type
          initialization by returning <symbol>t</symbol> from their
          method, and <symbol>nil</symbol> otherwise.  Methods for
          this generic function are allowed to signal errors of type
-         <errortype>maisql-error</errortype> or subtypes thereof.
+         <errortype>clsql-error</errortype> or subtypes thereof.
          They may also signal other types of conditions, if
          appropriate, but have to document this.</para>
       </refsect1>
          They may also signal other types of conditions, if
          appropriate, but have to document this.</para>
       </refsect1>
       </refsect1>
       <refsect1>
        <title>Exceptional Situations</title>
       </refsect1>
       <refsect1>
        <title>Exceptional Situations</title>
-       <para>Conditions of type <errortype>maisql-error</errortype>
+       <para>Conditions of type <errortype>clsql-error</errortype>
          or other conditions may be signalled, depending on the
          database back-end.</para>
       </refsect1>
          or other conditions may be signalled, depending on the
          database back-end.</para>
       </refsect1>
index b88e0546461bce6b9235c7fa4d50dbacf2f884e5..264c71b51fff17fed48baa4221db803fe031c946 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: mysql-sql.cl,v 1.18 2002/03/30 05:07:02 kevin Exp $
+;;;; $Id: mysql-sql.cl,v 1.19 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -90,6 +90,9 @@
   ((mysql-ptr :accessor database-mysql-ptr :initarg :mysql-ptr
              :type mysql-mysql-ptr-def)))
 
   ((mysql-ptr :accessor database-mysql-ptr :initarg :mysql-ptr
              :type mysql-mysql-ptr-def)))
 
+(defmethod database-type ((database mysql-database))
+  :mysql)
+
 (defmethod database-name-from-spec (connection-spec (database-type (eql :mysql)))
   (check-connection-spec connection-spec database-type (host db user password))
   (destructuring-bind (host db user password) connection-spec
 (defmethod database-name-from-spec (connection-spec (database-type (eql :mysql)))
   (check-connection-spec connection-spec database-type (host db user password))
   (destructuring-bind (host db user password) connection-spec
                  (make-instance 'mysql-database
                    :name (database-name-from-spec connection-spec
                                                   database-type)
                  (make-instance 'mysql-database
                    :name (database-name-from-spec connection-spec
                                                   database-type)
+                   :connection-spec connection-spec
                    :mysql-ptr mysql-ptr))
              (when error-occurred (mysql-close mysql-ptr)))))))))
 
                    :mysql-ptr mysql-ptr))
              (when error-occurred (mysql-close mysql-ptr)))))))))
 
index 3a0d4911945ea815e310fada64ca9d3fdff5df6f..777a0957a309b31d7acccd144fbd21e77d88b352 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-socket-sql.cl,v 1.10 2002/03/29 09:37:24 kevin Exp $
+;;;; $Id: postgresql-socket-sql.cl,v 1.11 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -137,16 +137,19 @@ doesn't depend on UFFI."
         ;; KMR - removed double @@
         ,@body))))
 
         ;; KMR - removed double @@
         ,@body))))
 
-(defmethod database-initialize-database-type
-    ((database-type (eql :postgresql-socket)))
+(defmethod database-initialize-database-type ((database-type
+                                              (eql :postgresql-socket)))
   t)
 
 (defclass postgresql-socket-database (database)
   ((connection :accessor database-connection :initarg :connection
               :type postgresql-connection)))
 
   t)
 
 (defclass postgresql-socket-database (database)
   ((connection :accessor database-connection :initarg :connection
               :type postgresql-connection)))
 
-(defmethod database-name-from-spec
-    (connection-spec (database-type (eql :postgresql-socket)))
+(defmethod database-type ((database postgresql-socket-database))
+  :postgresql-socket)
+
+(defmethod database-name-from-spec (connection-spec
+                                   (database-type (eql :postgresql-socket)))
   (check-connection-spec connection-spec database-type
                         (host db user password &optional port options tty))
   (destructuring-bind (host db user password &optional port options tty)
   (check-connection-spec connection-spec database-type
                         (host db user password &optional port options tty))
   (destructuring-bind (host db user password &optional port options tty)
@@ -154,8 +157,8 @@ doesn't depend on UFFI."
     (declare (ignore password options tty))
     (concatenate 'string host (if port ":") (if port port) "/" db "/" user)))
 
     (declare (ignore password options tty))
     (concatenate 'string host (if port ":") (if port port) "/" db "/" user)))
 
-(defmethod database-connect
-    (connection-spec (database-type (eql :postgresql-socket)))
+(defmethod database-connect (connection-spec 
+                            (database-type (eql :postgresql-socket)))
   (check-connection-spec connection-spec database-type
                         (host db user password &optional port options tty))
   (destructuring-bind (host db user password &optional
   (check-connection-spec connection-spec database-type
                         (host db user password &optional port options tty))
   (destructuring-bind (host db user password &optional
@@ -178,6 +181,7 @@ doesn't depend on UFFI."
        (make-instance 'postgresql-socket-database
                       :name (database-name-from-spec connection-spec
                                                      database-type)
        (make-instance 'postgresql-socket-database
                       :name (database-name-from-spec connection-spec
                                                      database-type)
+                      :connection-spec connection-spec
                       :connection connection))
       (postgresql-error (c)
        ;; Connect failed
                       :connection connection))
       (postgresql-error (c)
        ;; Connect failed
index 4104afa13048ba37f1c421c2a0c36ddfb9f418dd..809507c2e341e04752671612bc9faf432d962da5 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-sql.cl,v 1.14 2002/04/23 18:28:02 kevin Exp $
+;;;; $Id: postgresql-sql.cl,v 1.15 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -87,6 +87,9 @@
   ((conn-ptr :accessor database-conn-ptr :initarg :conn-ptr
             :type pgsql-conn-def)))
 
   ((conn-ptr :accessor database-conn-ptr :initarg :conn-ptr
             :type pgsql-conn-def)))
 
+(defmethod database-type ((database postgresql-database))
+  :postgresql)
+
 (defmethod database-name-from-spec (connection-spec (database-type
                                                     (eql :postgresql)))
   (check-connection-spec connection-spec database-type
 (defmethod database-name-from-spec (connection-spec (database-type
                                                     (eql :postgresql)))
   (check-connection-spec connection-spec database-type
        (make-instance 'postgresql-database
                       :name (database-name-from-spec connection-spec
                                                      database-type)
        (make-instance 'postgresql-database
                       :name (database-name-from-spec connection-spec
                                                      database-type)
+                      :connection-spec connection-spec
                       :conn-ptr connection)))))
 
 
                       :conn-ptr connection)))))
 
 
index 8ba8c265b1fe4e3e0097867cad547cad7cc2de0a..7a3f336a7cc6a61237b37a487e21350e4135341f 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                 Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                 Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: classes.cl,v 1.1 2002/03/29 08:13:02 kevin Exp $
+;;;; $Id: classes.cl,v 1.2 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -23,7 +23,9 @@
 
 
 (defclass database ()
 
 
 (defclass database ()
-  ((name :initarg :name :reader database-name))
+  ((name :initarg :name :reader database-name)
+   (connection-spec :initarg :connection-spec :reader connection-spec
+                   :documentation "Require to use connection pool"))
   (:documentation
    "This class is the supertype of all databases handled by CLSQL."))
 
   (:documentation
    "This class is the supertype of all databases handled by CLSQL."))
 
index 1ce86816d597771845e83075b4152cd12ed33a3c..b2dd41ec5df64103d2227721bb3bf1c8fd016152 100644 (file)
@@ -9,7 +9,7 @@
 ;;;;                onShoreD to support UncommonSQL front-end 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                onShoreD to support UncommonSQL front-end 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: db-interface.cl,v 1.6 2002/04/19 20:25:20 marc.battyani Exp $
+;;;; $Id: db-interface.cl,v 1.7 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai, and onShoreD
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai, and onShoreD
    "The internal generic implementation for checking if
 database type library loaded successfully."))
 
    "The internal generic implementation for checking if
 database type library loaded successfully."))
 
+(defgeneric database-type (database-type)
+  (:documentation
+   "Returns database type")
+  (:method (database-type)
+          (declare (ignore database-type))
+          (signal-nodb-error database)))
+
+
 (defgeneric database-initialize-database-type (database-type)
   (:documentation
    "The internal generic implementation of initialize-database-type."))
 (defgeneric database-initialize-database-type (database-type)
   (:documentation
    "The internal generic implementation of initialize-database-type."))
index 2db3c446215c5c078e11d67ee03666b056ea0195..36248198843712962e1248231720c290a8724eb7 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: package.cl,v 1.7 2002/04/19 20:25:20 marc.battyani Exp $
+;;;; $Id: package.cl,v 1.8 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -58,6 +58,9 @@
      #:database-read-large-object
      #:database-delete-large-object
      
      #:database-read-large-object
      #:database-delete-large-object
      
+     ;; Pooled connections
+     #:disconnect-pooled
+     
      ;; Shared exports for re-export by CLSQL
      .
      #1=(#:clsql-condition
      ;; Shared exports for re-export by CLSQL
      .
      #1=(#:clsql-condition
diff --git a/sql/pool.cl b/sql/pool.cl
new file mode 100644 (file)
index 0000000..298f1e3
--- /dev/null
@@ -0,0 +1,59 @@
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name:          pool.cl
+;;;; Purpose:       Support function for connection pool
+;;;; Programmers:   Kevin M. Rosenberg
+;;;; Date Started:  Apr 2002
+;;;;
+;;;; $Id: pool.cl,v 1.1 2002/04/27 20:58:11 kevin Exp $
+;;;;
+;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;;
+;;;; CLSQL users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
+;;;; *************************************************************************
+
+(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
+(in-package :clsql-sys)
+
+(defvar *db-pool* (make-hash-table :test #'equal))
+
+(defun make-conn-vector ()
+  "Creates an empty connection vector"
+  (make-array 5 :fill-pointer 0 :adjustable t))
+
+(defun find-or-create-conn-vector (connection-spec database-type)
+  "Find connection vector in hash table, creates a new conn-vector if not found"
+  (let* ((key (list connection-spec database-type))
+        (conn-vector (gethash *db-pool* key)))
+    (unless conn-vector
+      (setq conn-vector (make-conn-vector))
+      (setf (gethash *db-pool* key) conn-vector))
+    conn-vector))
+
+(defun acquire-from-pool (connection-spec database-type)
+  (let ((conn-vector (find-or-create-conn-vector connection-spec database-type)))
+    (when (zerop (length conn-vector))
+      (vector-push-extend 
+       (connect connection-spec :database-type database-type :if-exists :new) 
+       conn-vector))
+    (vector-pop conn-vector)))
+
+(defun release-to-pool (database)
+  (let ((conn-vector (find-or-create-conn-vector (connection-spec database)
+                                          (database-type database))))
+    (vector-push-extend database conn-vector)))
+
+(defun disconnect-pooled ()
+  "Disconnects all connections in the pool"
+  (maphash
+   #'(lambda (key conn-vector)
+       (declare (ignore key))
+       (dotimes (i (length conn-vector))
+        (disconnect (aref conn-vector i)))
+       (setf (fill-pointer conn-vector) 0))
+   *db-pool*)
+  t)
index 4b88fd584118ec8f3eb3023bd5d4b1ab4f0c9d04..f5eebd730768fe4ee6e75670b1a4fd2d0daa365c 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                 Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;;                 Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: sql.cl,v 1.12 2002/04/19 20:25:20 marc.battyani Exp $
+;;;; $Id: sql.cl,v 1.13 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -95,56 +95,59 @@ initialized, as indicated by `*initialized-database-types*'."
 
 (defun connect (connection-spec
                &key (if-exists *connect-if-exists*)
 
 (defun connect (connection-spec
                &key (if-exists *connect-if-exists*)
-               (database-type *default-database-type*))
+               (database-type *default-database-type*)
+               (pool nil))
   "Connects to a database of the given database-type, using the type-specific
 connection-spec.  if-exists is currently ignored."
   (let* ((db-name (database-name-from-spec connection-spec database-type))
         (old-db (find-database db-name nil))
         (result nil))
   "Connects to a database of the given database-type, using the type-specific
 connection-spec.  if-exists is currently ignored."
   (let* ((db-name (database-name-from-spec connection-spec database-type))
         (old-db (find-database db-name nil))
         (result nil))
-    (if old-db
-       (case if-exists
-         (:new
-          (setq result
-                (database-connect connection-spec database-type)))
-         (:warn-new
-          (setq result
-                (database-connect connection-spec database-type))
-          (warn 'clsql-exists-warning :old-db old-db :new-db result))
-         (:error
-          (restart-case
-              (error 'clsql-exists-error :old-db old-db)
-            (create-new ()
-              :report "Create a new connection."
-              (setq result
-                    (database-connect connection-spec database-type)))
-            (use-old ()
-              :report "Use the existing connection."
-              (setq result old-db))))
-         (:warn-old
-          (setq result old-db)
-          (warn 'clsql-exists-warning :old-db old-db :new-db old-db))
-         (:old
-          (setq result old-db)))
+    (if pool
+       (setq result (acquire-from-pool connection-spec database-type))
+      (if old-db
+         (case if-exists
+           (:new
+            (setq result
+              (database-connect connection-spec database-type)))
+           (:warn-new
+            (setq result
+              (database-connect connection-spec database-type))
+            (warn 'clsql-exists-warning :old-db old-db :new-db result))
+           (:error
+            (restart-case
+                (error 'clsql-exists-error :old-db old-db)
+              (create-new ()
+                  :report "Create a new connection."
+                (setq result
+                  (database-connect connection-spec database-type)))
+              (use-old ()
+                  :report "Use the existing connection."
+                (setq result old-db))))
+           (:warn-old
+            (setq result old-db)
+            (warn 'clsql-exists-warning :old-db old-db :new-db old-db))
+           (:old
+            (setq result old-db)))
        (setq result
        (setq result
-             (database-connect connection-spec database-type)))
+         (database-connect connection-spec database-type))))
     (when result
       (pushnew result *connected-databases*)
       (setq *default-database* result)
       result)))
 
 
     (when result
       (pushnew result *connected-databases*)
       (setq *default-database* result)
       result)))
 
 
-
-(defun disconnect (&key (database *default-database*))
+(defun disconnect (&key (database *default-database*)
+                  (pool nil))
   "Closes the connection to database. Resets *default-database* if that
 database was disconnected and only one other connection exists."
   "Closes the connection to database. Resets *default-database* if that
 database was disconnected and only one other connection exists."
-  (when (database-disconnect database)
-    (setq *connected-databases* (delete database *connected-databases*))
-    (when (eq database *default-database*)
-      (setq *default-database* (car *connected-databases*)))
-    (change-class database 'closed-database)
-    t))
-
-
+  (if pool
+      (release-to-pool database)
+    (when (database-disconnect database)
+      (setq *connected-databases* (delete database *connected-databases*))
+      (when (eq database *default-database*)
+       (setq *default-database* (car *connected-databases*)))
+      (change-class database 'closed-database)
+      t)))
 
 ;;; Basic operations on databases
 
 
 ;;; Basic operations on databases