X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fref-connect.xml;h=c3879b22ea71be587c2c315eed3d1fe1cc4d0dc2;hb=4871b9ef13ed1cf4f7ef927bd026ca19e845f53c;hp=84b33e519faaeb34355a07f122fcf3913d70908e;hpb=fdd069770e32d0cfa4b66d6e5cfd4540197660ba;p=clsql.git
diff --git a/doc/ref-connect.xml b/doc/ref-connect.xml
index 84b33e5..c3879b2 100644
--- a/doc/ref-connect.xml
+++ b/doc/ref-connect.xml
@@ -22,7 +22,7 @@
DATABASE
- ClassDATABASE
+ DATABASEThe super-type of all &clsql; databasesClass
@@ -71,7 +71,7 @@
*CONNECT-IF-EXISTS*
- Variable*CONNECT-IF-EXISTS*
+ *CONNECT-IF-EXISTS*Default value for the
if-exists parameter of connect.
@@ -80,7 +80,7 @@
Value TypeA valid argument to the if-exists
- parameter of connect, i.e. one of
+ parameter of connect, that is, one of
:new:warn-new
@@ -125,13 +125,67 @@
None.
+
+
+ *DB-POOL-MAX-FREE-CONNECTIONS*
+
+
+ *DB-POOL-MAX-FREE-CONNECTIONS*
+ How many free connections should the connection pool try to keep.
+ Parameter
+
+
+ Value Type
+ Integer
+
+
+ Initial Value
+ 4
+
+
+ Description
+ Threshold of free-connections in the pool before we disconnect a
+ database rather than returning it to the pool. This is really a heuristic
+that should, on avg keep the free connections about this size.
+
+ This is not a hard limit, the number of connections in
+ the pool may exceed this value.
+
+
+
+ Examples
+
+ (setf clsql-sys:*db-pool-max-free-connections* 2)
+
+
+
+ Affected By
+ None
+
+
+ See Also
+
+
+ connect
+ disconnect
+
+
+
+
+ Notes
+
+
+
+
+
+
*DEFAULT-DATABASE*
- Variable*DEFAULT-DATABASE*
+ *DEFAULT-DATABASE*The default database object to use.Variable
@@ -241,7 +295,7 @@
*DEFAULT-DATABASE-TYPE*
- Variable*DEFAULT-DATABASE-TYPE*
+ *DEFAULT-DATABASE-TYPE*The default database type to useVariable
@@ -300,7 +354,7 @@
*INITIALIZED-DATABASE-TYPES*
- Variable*INITIALIZED-DATABASE-TYPES*
+ *INITIALIZED-DATABASE-TYPES*List of all initialized database typesVariable
@@ -365,14 +419,13 @@
CONNECT
- FunctionCONNECT
+ CONNECTcreate a connection to a database.FunctionSyntax
- Syntax
- connectconnection-spec &key if-existsdatabase-typepoolmake-default => database
+ connectconnection-spec &key if-existsdatabase-typepoolmake-default => databaseArguments and Values
@@ -380,8 +433,14 @@
connection-spec
- A vendor specific connection specification supplied
- as a list or as a string.
+ A SQL backend specific connection specification
+ supplied as a list or as a string.
+ For the MySQL backend, this list includes an
+ optional associative list of connection options. The
+ options list is parsed and supplied to the MySQL API
+ using mysql_options in between the
+ calls to mysql_init
+ and mysql_real_connect.
@@ -545,8 +604,16 @@
Affected by
- *default-database-type*
- *connect-if-exists*
+
+
+ *default-database-type*
+
+
+
+
+ *connect-if-exists*
+
+
@@ -589,7 +656,7 @@
CONNECTED-DATABASES
- FunctionCONNECTED-DATABASES
+ CONNECTED-DATABASESReturn the list of active database objects.Function
@@ -681,7 +748,7 @@
DATABASE-NAME
- Generic FunctionDATABASE-NAME
+ DATABASE-NAMEGet the name of a database objectGeneric Function
@@ -798,7 +865,7 @@
DATABASE-NAME-FROM-SPEC
- Generic FunctionDATABASE-NAME-FROM-SPEC
+ DATABASE-NAME-FROM-SPECReturn the database name string corresponding to
the given connection specification.Generic Function
@@ -911,7 +978,7 @@
DATABASE-TYPE
- Generic FunctionDATABASE-TYPE
+ DATABASE-TYPEGet the type of a database object.Generic Function
@@ -1000,7 +1067,7 @@
DISCONNECT
- FunctionDISCONNECT
+ DISCONNECTclose a database connectionFunction
@@ -1067,24 +1134,46 @@
Side Effects
- The database connection is closed, and the database
- object is removed from the list of connected databases as
- returned by connected-databases.
- The state of the database object is changed to
- closed.
+ The database object is removed from the list of connected databases as
+ returned by connected-databases.If the database object passed is the same under
- eq as the value of
- *default-database*, then
- *default-database* is set to the first
- remaining database from
- connected-databases or to &nil; if no
- further active database exists.
+ eq as the value of
+ *default-database*, then
+ *default-database* is set to the first
+ remaining database from
+ connected-databases or to &nil; if no
+ further active database exists.
+
+ Non-pooled
+ The database connection is closed and the state of the
+ database object is changed to closed.
+
+
+ Pooled
+ Unless there are already
+ *db-pool-max-free-connections*
+ free connections in the pool it is returned to the
+ pool, with the backend having an opportunity to run
+ generic cleanup on the connection first. If the max free
+ connections has already been reached then it is
+ disconnected as if it were not in the pool.
+
+ Affected by
- *default-database*
+
+
+ *default-database*
+
+
+
+
+ *db-pool-max-free-connections*
+
+
@@ -1115,13 +1204,13 @@
DISCONNECT-POOLED
- FunctionDISCONNECT-POOLED
+ DISCONNECT-POOLEDcloses all pooled database connectionsFunctionSyntax
- disconnect-pooled => t
+ disconnect-pooled &optional clear => tDescription
@@ -1130,6 +1219,8 @@
linkend="connect">connect with
:pool &t;.
+ If optional argument clear is non-&nil;
+ then the connection-pool objects are also removed.Examples
@@ -1140,8 +1231,10 @@
Side Effects
- Database connections will be closed and entries in the pool are removed.
-
+ Database connections will be closed and *all* entries in
+ the pool are removed. This is done with great prejudice and no
+ thought to thread safety or whether that connection is
+ currently in use.Affected by
@@ -1179,7 +1272,7 @@
FIND-DATABASE
- FunctionFIND-DATABASE
+ FIND-DATABASE>Locate a database object through it's
name.Function
@@ -1331,7 +1424,7 @@
INITIALIZE-DATABASE-TYPE
- FunctionINITIALIZE-DATABASE-TYPE
+ INITIALIZE-DATABASE-TYPEInitializes a database typeFunction
@@ -1445,7 +1538,7 @@
RECONNECT
- FunctionRECONNECT
+ RECONNECTRe-establishes the connection between a database object and its RDBMS.Function
@@ -1570,7 +1663,7 @@
STATUS
- FunctionSTATUS
+ STATUSPrint information about connected databases.Function
@@ -1677,7 +1770,7 @@ CLSQL STATUS: 2004-06-13 15:08:08
CREATE-DATABASE
- FunctionCREATE-DATABASE
+ CREATE-DATABASEcreate a databaseFunction
@@ -1775,7 +1868,7 @@ error: 'Access denied for user: 'root@localhost' (Using password: YES)'
DESTROY-DATABASE
- FunctionDESTROY-DATABASE
+ DESTROY-DATABASEdestroys a databaseFunction
@@ -1826,7 +1919,7 @@ error: 'Access denied for user: 'root@localhost' (Using password: YES)'
=>
Error: While trying to access database localhost/test2/root
using database-type POSTGRESQL:
- Error database-destory failed: dropdb: database removal failed: ERROR: database "test2" does not exist
+ Error database-destroy failed: dropdb: database removal failed: ERROR: database "test2" does not exist
has occurred.
[condition type: CLSQL-ACCESS-ERROR]
@@ -1872,7 +1965,7 @@ Error: While trying to access database localhost/test2/root
PROBE-DATABASE
- FunctionPROBE-DATABASE
+ PROBE-DATABASEtests for existence of a databaseFunction
@@ -1955,7 +2048,7 @@ Error: While trying to access database localhost/test2/root
LIST-DATABASES
- FunctionLIST-DATABASES
+ LIST-DATABASESList databases matching the supplied connection spec
and database type.Function
@@ -2053,7 +2146,7 @@ Error: While trying to access database localhost/test2/root
WITH-DATABASE
- MacroWITH-DATABASE
+ WITH-DATABASEExecute a body of code with a variable bound to a
specified database object.Macro
@@ -2069,7 +2162,7 @@ Error: While trying to access database localhost/test2/root
db-var
- A variable to which the specified database is bound.
+ A variable which is bound to the specified database.
@@ -2083,7 +2176,12 @@ Error: While trying to access database localhost/test2/root
connect-args
- Other optional arguments to connect.
+ Other optional arguments to
+ connect. This macro use a value of
+ &nil; for connect's
+ make-default key, This is in
+ contrast to to the connect function which has a default
+ value of &t; for make-default.
@@ -2169,7 +2267,7 @@ Error: While trying to access database localhost/test2/root
WITH-DEFAULT-DATABASE
- MacroWITH-DEFAULT-DATABASE
+ WITH-DEFAULT-DATABASEExecute a body of code with *default-database* bound to a specified database.Macro