Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 204ec3a8a895ae5700811efd516cad83 > files > 13

libzdb-devel-2.8.1-1.fc15.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libzdb: ConnectionPool.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<style type="text/css" media="screen">
    body,div,p,dl{font: normal normal normal 14px/18px Helvetica,Arial,sans-serif;}
</style>
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="contents">
<h1>ConnectionPool.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
A <b>ConnectionPool</b> represent a database connection pool. 
<p>
A connection pool can be used to get a connection to a database and execute statements. This class opens a number of database connections and allow callers to obtain and use a database connection in a reentrant manner. Applications can instantiate as many ConnectionPool objects as needed and against as many different database systems as needed.<p>
<center><div align="center">
<img src="database.png" alt="database.png">
</div>
</center><p>
The method <a class="el" href="ConnectionPool_8h.html#eb9223e1addafed257e35e248c049097" title="Get a connection from the pool.">ConnectionPool_getConnection()</a> is used to obtain a new connection from the pool. If there are no connections available it will create a new connection and return this. If the pool has already handed out <em>maxConnections</em> the next call to <a class="el" href="ConnectionPool_8h.html#eb9223e1addafed257e35e248c049097" title="Get a connection from the pool.">ConnectionPool_getConnection()</a> will return NULL. Use <a class="el" href="Connection_8h.html#ac4c939875fb240528435d486b484a7f" title="Return connection to the connection pool.">Connection_close()</a> to return a connection to the pool so it can be reused.<p>
A connection pool is created default with 5 initial connections and with 20 maximum connections. These values can be changed by the property methods <a class="el" href="ConnectionPool_8h.html#99b15436eda4986b28cc472ba39adefb" title="Set the number of initial connections to start the pool with.">ConnectionPool_setInitialConnections()</a> and <a class="el" href="ConnectionPool_8h.html#68ac953c1bc1915b3ac6ae0b7b4c64a4" title="Set the maximum number of connections this connection pool will create.">ConnectionPool_setMaxConnections()</a>.<p>
<h2>Supported database systems:</h2>
<p>
This library may be built with support for many different database systems. To test if a particular system is supported use the method <a class="el" href="Connection_8h.html#518c866ed09a2520fd43d153bebc2e8d" title="Class method, test if the specified database system is supported by this library...">Connection_isSupported()</a>.<p>
<h2>Life-cycle methods:</h2>
<p>
Clients should call <a class="el" href="ConnectionPool_8h.html#8d7c529ccb99d0345e0c8524dba7281d" title="Prepare for the beginning of active use of this component.">ConnectionPool_start()</a> to establish the connection pool against the database server and before using the pool. To shutdown connections from the database server use <a class="el" href="ConnectionPool_8h.html#c467a51ff4471989abbe07be1870072d" title="Gracefully terminate the active use of the public methods of this component.">ConnectionPool_stop()</a>. Set preferred properties before calling <a class="el" href="ConnectionPool_8h.html#8d7c529ccb99d0345e0c8524dba7281d" title="Prepare for the beginning of active use of this component.">ConnectionPool_start()</a>. Some properties can also be changed dynamically after the pool was started such as changing the maximum number of connections or redefine the number of initial connections. Changing and tuning these properties at runtime is most useful if the pool was started with a reaper-thread (see below) since the reaper dynamically change the size of the pool<p>
<h2>Connection URL:</h2>
<p>
The URL given to a Connection Pool at creation time specify a database connection on the standard URL format. The format of the connection URL is defined as:<p>
 
 <center><code>
 database://[user:password@][host][:port]/database[?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
 </code></center>
 <p>
The property names <code>user</code> and <code>password</code> are always recognized and specify how to login to the database. Other properties depends on the database server in question. User name and password can alternatively be specified in the auth-part of the URL. If port number is omitted, the default port number for the database server is used.<p>
<b>MySQL:</b><p>
Here is an example on how to connect to a <a href="http://www.mysql.org/">mysql</a> database server:<p>
 
 <dt><dd><code>
 mysql://localhost:3306/test?user=root&password=swordfish<br/>
 </code></dd></dt>
 <p>
In this case the username, <code>root</code> and password, <code>swordfish </code> are specified as properties to the URL. Another alternative is to use the auth-part of the URL to specify authentication information:<p>
 
 <dt><dd><code>
 mysql://root:swordfish@localhost:3306/test
 </code></dd></dt>
 <p>
See <a href="mysqloptions.html">mysql options</a> for all properties that can be set for a mysql connection URL.<p>
<b>SQLite:</b><p>
For a <a href="http://www.sqlite.org/">SQLite</a> database the connection URL should simply specify the database file, since a SQLite database is just a file in the filesystem. SQLite uses <a href="http://sqlite.org/pragma.html">pragma commands</a> for performance tuning and other special purpose database commands. Pragma syntax on the form, <code>name=value</code> can be added as properties to the URL and will be set when the Connection is created. In addition to pragmas, the following properties are supported: <ul>
<li>
<code>heap_limit=value</code> - Make SQLite auto-release unused memory if memory usage goes above the specified value [KB]. </li>
</ul>
An URL for connecting to a SQLite database might look like:<p>
 
 <dt><dd><code>
 sqlite:///var/sqlite/test.db?synchronous=normal&heap_limit=8000&foreign_keys=on
 </code></dd></dt>
 <p>
<b>PostgreSQL:</b><p>
The URL for connecting to a <a href="http://www.postgresql.org/">PostgreSQL</a> database server might look like:<p>
 
 <dt><dd><code>
 postgresql://localhost:5432/test?user=root&password=swordfish<br/>
 </code></dd></dt>
 <p>
As with the MySQL URL, the username and password are specified as properties to the URL. Likewise, the auth-part of the URL can be used instead, to specify the username and the password:<p>
 
 <dt><dd><code>
 postgresql://root:swordfish@localhost/test?use-ssl=true
 </code></dd></dt>
 <p>
In this example we have also omitted the port number to the server, in which case the default port number, <em>5432</em>, for PostgreSQL is used. In addition we have added an extra parameter to the URL, so connection to the server is done over a secure SSL connection.<p>
See <a href="postgresoptions.html">postgresql options</a> for all properties that can be set for a postgresql connection URL.<p>
<b>Oracle:</b><p>
The URL for connecting to an <a href="http://www.oracle.com/">Oracle</a> database server might look like:<p>
 
 <dt><dd><code>
 oracle://localhost:1521/test?user=scott&password=tiger<br/>
 </code></dd></dt>
 <p>
The auth-part of the URL can be used instead to specify the username and the password. In addition, you may specify a service name in the URL instead if you have setup a <code>tnsnames.ora</code> configuration file.<p>
 
 <dt><dd><code>
 oracle:///servicename?user=scott&password=tiger
 </code></dd></dt>
 <p>
<h2>Example:</h2>
<p>
To obtain a connection pool for a MySQL database, the code below can be used. The exact same code can be used for PostgreSQL, SQLite and Oracle, the only change needed is to modify the Connection URL. Here we connect to the database test on localhost and start the pool with the default 5 initial connections.<p>
 
 <dt><dd><code>
 <pre>
 URL_T url = URL_new("mysql://localhost/test?user=root&password=swordfish");
 ConnectionPool_T pool = ConnectionPool_new(url);
 ConnectionPool_start(pool);
 [..]
 <b>Connection_T con = ConnectionPool_getConnection(pool);</b>
 ResultSet_T result = Connection_executeQuery(con, "select id, name, image from employee where salary>%d", anumber);
 while (ResultSet_next(result)) 
 {
      int id = ResultSet_getInt(result, 1);
      const char *name = ResultSet_getString(result, 2);
      int blobSize;
      const void *image = ResultSet_getBlob(result, 3, &blobSize);
      [..]
 }
 <b>Connection_close(con);</b>
 [..]
 ConnectionPool_free(&pool);
 URL_free(&url);
 </pre>
 </code></dd></dt>
 <p>
<h2>Optimizing the pool size:</h2>
<p>
The pool can be setup to dynamically change the number of active Connections in the pool depending on the load. A single <code>reaper</code> thread can be activated at startup to sweep through the pool at a regular interval and close Connections that have been inactive for a specified time or for some reasons no longer respond. Only inactive Connections will be closed and no more than the initial number of Connections the pool was started with are closed. The property method, <a class="el" href="ConnectionPool_8h.html#756268df598fb93caeef570b775e6768" title="Specify that a reaper thread should be used by the pool.">ConnectionPool_setReaper()</a>, is used to specify that a reaper thread should be started when the pool is started. If this method was not called <em>before</em> <a class="el" href="ConnectionPool_8h.html#8d7c529ccb99d0345e0c8524dba7281d" title="Prepare for the beginning of active use of this component.">ConnectionPool_start()</a>, the pool will not start with a reaper thread.<p>
Clients can also call the method, <a class="el" href="ConnectionPool_8h.html#75e9b1e5c943a5bb76573a04268e496a" title="Close all inactive Connections in the pool, down to initial connections.">ConnectionPool_reapConnections()</a>, to bonsai the pool directly if the reaper thread is not activated.<p>
It is recommended to start the pool with a reaper-thread, especially if the pool maintains TCP/IP Connections.<p>
<h2>Realtime inspection:</h2>
<p>
Two methods can be used to inspect the pool at runtime. The method <a class="el" href="ConnectionPool_8h.html#76aacfe23b7708d436347107aedf0d15" title="Returns the current number of connections in the pool.">ConnectionPool_size()</a> returns the number of connections in the pool, that is, both active and inactive connections. The method <a class="el" href="ConnectionPool_8h.html#3c54f3a36f5dd94b2c622c01010df15f" title="Returns the number of active connections in the pool.">ConnectionPool_active()</a> returns the number of active connections, i.e. those connections in current use by your application.<p>
<em>This ConnectionPool is thread-safe.</em><p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> <a class="el" href="ResultSet_8h.html" title="A ResultSet represents a database result set.">ResultSet.h</a> <a class="el" href="URL_8h.html" title="URL represent an immutable Uniform Resource Locator.">URL.h</a> <a class="el" href="PreparedStatement_8h.html" title="A PreparedStatement represent a single SQL statement pre-compiled into byte code...">PreparedStatement.h</a> </dd></dl>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#0acb682b8260ab1c60b918599864e2e5">T</a>&nbsp;&nbsp;&nbsp;ConnectionPool_T</td></tr>

<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#24514489b0962fafe8414bfae95aa268">T</a></td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#a808a931fc4e79ff34941ee5a46de8cb">ConnectionPool_new</a> (URL_T url)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new ConnectionPool.  <a href="#a808a931fc4e79ff34941ee5a46de8cb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#6ca3943e0f711030bf0bf3cf83e0abef">ConnectionPool_free</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> *P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disconnect and destroy the pool and release allocated resources.  <a href="#6ca3943e0f711030bf0bf3cf83e0abef"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#8d7c529ccb99d0345e0c8524dba7281d">ConnectionPool_start</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepare for the beginning of active use of this component.  <a href="#8d7c529ccb99d0345e0c8524dba7281d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#c467a51ff4471989abbe07be1870072d">ConnectionPool_stop</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gracefully terminate the active use of the public methods of this component.  <a href="#c467a51ff4471989abbe07be1870072d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">Connection_T&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#eb9223e1addafed257e35e248c049097">ConnectionPool_getConnection</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a connection from the pool.  <a href="#eb9223e1addafed257e35e248c049097"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#5d1f04dc0ae5fc42707dfd934f681c4a">ConnectionPool_returnConnection</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P, Connection_T connection)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a connection to the pool.  <a href="#5d1f04dc0ae5fc42707dfd934f681c4a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#75e9b1e5c943a5bb76573a04268e496a">ConnectionPool_reapConnections</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close all inactive Connections in the pool, down to initial connections.  <a href="#75e9b1e5c943a5bb76573a04268e496a"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Properties</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">URL_T&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#58a3cd3c193bd0d51a987a15539e3b48">ConnectionPool_getURL</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns this Connection Pool URL.  <a href="#58a3cd3c193bd0d51a987a15539e3b48"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#99b15436eda4986b28cc472ba39adefb">ConnectionPool_setInitialConnections</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P, int connections)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the number of initial connections to start the pool with.  <a href="#99b15436eda4986b28cc472ba39adefb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#a6a2130831722010e89924aec17fe561">ConnectionPool_getInitialConnections</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the number of initial connections to start the pool with.  <a href="#a6a2130831722010e89924aec17fe561"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#68ac953c1bc1915b3ac6ae0b7b4c64a4">ConnectionPool_setMaxConnections</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P, int maxConnections)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the maximum number of connections this connection pool will create.  <a href="#68ac953c1bc1915b3ac6ae0b7b4c64a4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#5edf7736ec825e4a1aafd4f7f85c24d5">ConnectionPool_getMaxConnections</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the maximum number of connections this Connection pool will create.  <a href="#5edf7736ec825e4a1aafd4f7f85c24d5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#143b4171cc03227b1bca5cd10e724bc5">ConnectionPool_setConnectionTimeout</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P, int connectionTimeout)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set a Connection inactive timeout value in seconds.  <a href="#143b4171cc03227b1bca5cd10e724bc5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#d2dabf50cf0b9710848eba40c58bf748">ConnectionPool_getConnectionTimeout</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the connection timeout value in seconds.  <a href="#d2dabf50cf0b9710848eba40c58bf748"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#23b8c11de2c910a5ce75b008291ee22a">ConnectionPool_setAbortHandler</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P, void(*abortHandler)(const char *error))</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the function to call if a fatal error occurs in the library.  <a href="#23b8c11de2c910a5ce75b008291ee22a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#756268df598fb93caeef570b775e6768">ConnectionPool_setReaper</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P, int sweepInterval)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specify that a reaper thread should be used by the pool.  <a href="#756268df598fb93caeef570b775e6768"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#76aacfe23b7708d436347107aedf0d15">ConnectionPool_size</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the current number of connections in the pool.  <a href="#76aacfe23b7708d436347107aedf0d15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#3c54f3a36f5dd94b2c622c01010df15f">ConnectionPool_active</a> (<a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> P)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of active connections in the pool.  <a href="#3c54f3a36f5dd94b2c622c01010df15f"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">class methods</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#b7d96fe7a5feaefd73f411a092721868">ConnectionPool_version</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><b>Class method</b>, returns this library version information  <a href="#b7d96fe7a5feaefd73f411a092721868"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ConnectionPool_8h.html#7886fb40d7187a54bb9a5ef8899616ce">ZBDEBUG</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Library Debug flag.  <a href="#7886fb40d7187a54bb9a5ef8899616ce"></a><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="0acb682b8260ab1c60b918599864e2e5"></a><!-- doxytag: member="ConnectionPool.h::T" ref="0acb682b8260ab1c60b918599864e2e5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;&nbsp;&nbsp;ConnectionPool_T          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="24514489b0962fafe8414bfae95aa268"></a><!-- doxytag: member="ConnectionPool.h::T" ref="24514489b0962fafe8414bfae95aa268" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>* <a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a808a931fc4e79ff34941ee5a46de8cb"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_new" ref="a808a931fc4e79ff34941ee5a46de8cb" args="(URL_T url)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> ConnectionPool_new           </td>
          <td>(</td>
          <td class="paramtype">URL_T&nbsp;</td>
          <td class="paramname"> <em>url</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a new ConnectionPool. 
<p>
The pool is created with default 5 initial connections. Maximum connections is set to 20. Property methods in this interface can be used to change the default values. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>url</em>&nbsp;</td><td>The database connection url </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A new ConnectionPool object or NULL if the URL cannot be parsed </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="URL_8h.html" title="URL represent an immutable Uniform Resource Locator.">URL.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="6ca3943e0f711030bf0bf3cf83e0abef"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_free" ref="6ca3943e0f711030bf0bf3cf83e0abef" args="(T *P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_free           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a> *&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Disconnect and destroy the pool and release allocated resources. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object reference </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="58a3cd3c193bd0d51a987a15539e3b48"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_getURL" ref="58a3cd3c193bd0d51a987a15539e3b48" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">URL_T ConnectionPool_getURL           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns this Connection Pool URL. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>This Connection Pool URL </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="URL_8h.html" title="URL represent an immutable Uniform Resource Locator.">URL.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="99b15436eda4986b28cc472ba39adefb"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_setInitialConnections" ref="99b15436eda4986b28cc472ba39adefb" args="(T P, int connections)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_setInitialConnections           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>connections</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the number of initial connections to start the pool with. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>connections</em>&nbsp;</td><td>The number of initial pool connections </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="a6a2130831722010e89924aec17fe561"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_getInitialConnections" ref="a6a2130831722010e89924aec17fe561" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ConnectionPool_getInitialConnections           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the number of initial connections to start the pool with. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of initial pool connections </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="68ac953c1bc1915b3ac6ae0b7b4c64a4"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_setMaxConnections" ref="68ac953c1bc1915b3ac6ae0b7b4c64a4" args="(T P, int maxConnections)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_setMaxConnections           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>maxConnections</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the maximum number of connections this connection pool will create. 
<p>
If max connections has been served, <a class="el" href="ConnectionPool_8h.html#eb9223e1addafed257e35e248c049097" title="Get a connection from the pool.">ConnectionPool_getConnection()</a> will return NULL on the next call. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>maxConnections</em>&nbsp;</td><td>The maximum number of connections this connection pool will create. It is a checked runtime error for maxConnections to be less than initialConnections. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="5edf7736ec825e4a1aafd4f7f85c24d5"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_getMaxConnections" ref="5edf7736ec825e4a1aafd4f7f85c24d5" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ConnectionPool_getMaxConnections           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the maximum number of connections this Connection pool will create. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The maximum number of connections this connection pool will create. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="143b4171cc03227b1bca5cd10e724bc5"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_setConnectionTimeout" ref="143b4171cc03227b1bca5cd10e724bc5" args="(T P, int connectionTimeout)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_setConnectionTimeout           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>connectionTimeout</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set a Connection inactive timeout value in seconds. 
<p>
The method, <a class="el" href="ConnectionPool_8h.html#75e9b1e5c943a5bb76573a04268e496a" title="Close all inactive Connections in the pool, down to initial connections.">ConnectionPool_reapConnections()</a>, if called will close inactive Connections in the pool which has not been in use since <code>connectionTimeout</code> seconds. Default connectionTimeout is 30 seconds. The reaper thread if in use, see <a class="el" href="ConnectionPool_8h.html#756268df598fb93caeef570b775e6768" title="Specify that a reaper thread should be used by the pool.">ConnectionPool_setReaper()</a>, also use this value when closing inactive Connections. It is a checked runtime error for <code>connectionTimeout</code> to be less than, or equal to zero. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>connectionTimeout</em>&nbsp;</td><td>The number of <code>seconds</code> a Connection can be inactive, i.e. not in use, before the reaper close the Connection. (value &gt; 0) </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="d2dabf50cf0b9710848eba40c58bf748"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_getConnectionTimeout" ref="d2dabf50cf0b9710848eba40c58bf748" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ConnectionPool_getConnectionTimeout           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the connection timeout value in seconds. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The time an inactive Connection may live before it is closed </dd></dl>

</div>
</div><p>
<a class="anchor" name="23b8c11de2c910a5ce75b008291ee22a"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_setAbortHandler" ref="23b8c11de2c910a5ce75b008291ee22a" args="(T P, void(*abortHandler)(const char *error))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_setAbortHandler           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(const char *error)&nbsp;</td>
          <td class="paramname"> <em>abortHandler</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the function to call if a fatal error occurs in the library. 
<p>
In practice this means Out-Of-Memory errors or uncatched exceptions. Clients may optionally provide this function. If not provided the library will call <code>abort(3)</code> upon encountering a fatal error. This method provide clients with means to close down execution gracefully. It is an unchecked runtime error to continue using the library after the <code>abortHandler</code> was called. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>abortHandler</em>&nbsp;</td><td>The handler function to call should a fatal error occur during processing. An explanatory error message is passed to the handler function in the string <code>error</code> </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Exception_8h.html" title="An Exception indicate an error condition from which recovery may be possible.">Exception.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="756268df598fb93caeef570b775e6768"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_setReaper" ref="756268df598fb93caeef570b775e6768" args="(T P, int sweepInterval)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_setReaper           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>sweepInterval</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Specify that a reaper thread should be used by the pool. 
<p>
This thread will close all inactive Connections in the pool, down to initial connections. An inactive Connection is closed if and only if its <code>connectionTimeout</code> has expired <em>or</em> if the Connection failed the ping test. Active Connections, that is, connections in current use by your application are <em>never </em> closed by this thread. This method sets the reaper thread sweep properties, but does not start the thread. This is done in <a class="el" href="ConnectionPool_8h.html#8d7c529ccb99d0345e0c8524dba7281d" title="Prepare for the beginning of active use of this component.">ConnectionPool_start()</a>. So, if the pool should use a reaper thread, remember to call this method <b>before</b> <a class="el" href="ConnectionPool_8h.html#8d7c529ccb99d0345e0c8524dba7281d" title="Prepare for the beginning of active use of this component.">ConnectionPool_start()</a>. It is a checked runtime error for <code>sweepInterval</code> to be less than, or equal to zero. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sweepInterval</em>&nbsp;</td><td>Number of <code>seconds</code> between sweeps of the reaper thread (value &gt; 0) </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="76aacfe23b7708d436347107aedf0d15"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_size" ref="76aacfe23b7708d436347107aedf0d15" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ConnectionPool_size           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the current number of connections in the pool. 
<p>
The number of both active and inactive connections are returned. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of connections in the pool </dd></dl>

</div>
</div><p>
<a class="anchor" name="3c54f3a36f5dd94b2c622c01010df15f"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_active" ref="3c54f3a36f5dd94b2c622c01010df15f" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ConnectionPool_active           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the number of active connections in the pool. 
<p>
I.e. connections in use by clients. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of active connections in the pool </dd></dl>

</div>
</div><p>
<a class="anchor" name="8d7c529ccb99d0345e0c8524dba7281d"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_start" ref="8d7c529ccb99d0345e0c8524dba7281d" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_start           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Prepare for the beginning of active use of this component. 
<p>
This method must be called before the pool is used and will connect to the database server and create the initial connections for the pool. This method will also start the reaper thread if specified via <a class="el" href="ConnectionPool_8h.html#756268df598fb93caeef570b775e6768" title="Specify that a reaper thread should be used by the pool.">ConnectionPool_setReaper()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="c467a51ff4471989abbe07be1870072d"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_stop" ref="c467a51ff4471989abbe07be1870072d" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_stop           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Gracefully terminate the active use of the public methods of this component. 
<p>
This method should be the last one called on a given instance of this component. Calling this method close down all connections in the pool, disconnect the pool from the database server and stop the reaper thread if it was started. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="eb9223e1addafed257e35e248c049097"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_getConnection" ref="eb9223e1addafed257e35e248c049097" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Connection_T ConnectionPool_getConnection           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a connection from the pool. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A connection from the pool or NULL if maxConnection is reached </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="5d1f04dc0ae5fc42707dfd934f681c4a"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_returnConnection" ref="5d1f04dc0ae5fc42707dfd934f681c4a" args="(T P, Connection_T connection)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectionPool_returnConnection           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Connection_T&nbsp;</td>
          <td class="paramname"> <em>connection</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns a connection to the pool. 
<p>
The same as calling <a class="el" href="Connection_8h.html#ac4c939875fb240528435d486b484a7f" title="Return connection to the connection pool.">Connection_close()</a> <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>connection</em>&nbsp;</td><td>A Connection object </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="Connection_8h.html" title="A Connection represent a connection to a SQL database system.">Connection.h</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="75e9b1e5c943a5bb76573a04268e496a"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_reapConnections" ref="75e9b1e5c943a5bb76573a04268e496a" args="(T P)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ConnectionPool_reapConnections           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="URL_8h.html#24514489b0962fafe8414bfae95aa268">T</a>&nbsp;</td>
          <td class="paramname"> <em>P</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Close all inactive Connections in the pool, down to initial connections. 
<p>
Inactive Connection are closed if and only if its <code>connectionTimeout</code> has expired <em>or</em> if the Connection failed the ping test against the database. Active Connections are <em>not</em> closed by this method. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>P</em>&nbsp;</td><td>A ConnectionPool object </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of Connections that was closed </dd></dl>

</div>
</div><p>
<a class="anchor" name="b7d96fe7a5feaefd73f411a092721868"></a><!-- doxytag: member="ConnectionPool.h::ConnectionPool_version" ref="b7d96fe7a5feaefd73f411a092721868" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* ConnectionPool_version           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Class method</b>, returns this library version information 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Library version information </dd></dl>

</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="7886fb40d7187a54bb9a5ef8899616ce"></a><!-- doxytag: member="ConnectionPool.h::ZBDEBUG" ref="7886fb40d7187a54bb9a5ef8899616ce" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="ConnectionPool_8h.html#7886fb40d7187a54bb9a5ef8899616ce">ZBDEBUG</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Library Debug flag. 
<p>
If set to true, emit debug output 
</div>
</div><p>
</div>
<p style="text-align:center;color:#808080;font-size:90%;margin:40px 0 20px 0;">
Copyright &copy; 2004-2011 <a href="http://tildeslash.com/">Tildeslash Ltd</a>. All
rights reserved.</p>
</body></html>