<refentry id="GdaConnectionPool">
<refmeta>
<refentrytitle>GdaConnectionPool</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGDA-CLIENT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GdaConnectionPool</refname><refpurpose>Connection pools</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>



<link linkend="GdaConnectionPool">GdaConnectionPool</link>* <link linkend="gda-connection-pool-new">gda_connection_pool_new</link>  (void);
void        <link linkend="gda-connection-pool-free">gda_connection_pool_free</link>        (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool);
<link linkend="GdaConnection">GdaConnection</link>* <link linkend="gda-connection-pool-open-connection">gda_connection_pool_open_connection</link>
                                            (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             const <link linkend="gchar">gchar</link> *gda_name,
                                             const <link linkend="gchar">gchar</link> *username,
                                             const <link linkend="gchar">gchar</link> *password);
void        <link linkend="gda-connection-pool-close-connection">gda_connection_pool_close_connection</link>
                                            (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             <link linkend="GdaConnection">GdaConnection</link> *cnc);
void        <link linkend="gda-connection-pool-close-all">gda_connection_pool_close_all</link>   (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool);
void        (<link linkend="GdaConnectionPoolForeachFunc">*GdaConnectionPoolForeachFunc</link>) (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             <link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *gda_name,
                                             const <link linkend="gchar">gchar</link> *username,
                                             const <link linkend="gchar">gchar</link> *password,
                                             <link linkend="gpointer">gpointer</link> user_data);
void        <link linkend="gda-connection-pool-foreach">gda_connection_pool_foreach</link>     (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             <link linkend="GdaConnectionPoolForeachFunc">GdaConnectionPoolForeachFunc</link> func,
                                             <link linkend="gpointer">gpointer</link> user_data);

</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GtkObject">GtkObject</link>
   +----GdaConnectionPool
</synopsis>

</refsect1>


<refsect1>
<title>Signal Prototypes</title>
<synopsis>

&quot;<link linkend="GdaConnectionPool-open">open</link>&quot;      void        user_function      (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *gdaconnectionpool,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GdaConnectionPool-error">error</link>&quot;     void        user_function      (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *gdaconnectionpool,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsect1>


<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="gda-connection-pool-new">gda_connection_pool_new ()</title>
<programlisting><link linkend="GdaConnectionPool">GdaConnectionPool</link>* gda_connection_pool_new  (void);</programlisting>
<para>
Create a new <link linkend="GdaConnectionPool">GdaConnectionPool</link> object, which is used to manage connection
pools. These are very useful if you've got to manage several connections
to different data sources</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-pool-free">gda_connection_pool_free ()</title>
<programlisting>void        gda_connection_pool_free        (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pool</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-pool-open-connection">gda_connection_pool_open_connection ()</title>
<programlisting><link linkend="GdaConnection">GdaConnection</link>* gda_connection_pool_open_connection
                                            (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             const <link linkend="gchar">gchar</link> *gda_name,
                                             const <link linkend="gchar">gchar</link> *username,
                                             const <link linkend="gchar">gchar</link> *password);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pool</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdaConnectionPool">GdaConnectionPool</link> object
</entry></row>
<row><entry align="right"><parameter>gda_name</parameter>&nbsp;:</entry>
<entry> GDA data source name
</entry></row>
<row><entry align="right"><parameter>username</parameter>&nbsp;:</entry>
<entry> user name
</entry></row>
<row><entry align="right"><parameter>password</parameter>&nbsp;:</entry>
<entry> password
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-pool-close-connection">gda_connection_pool_close_connection ()</title>
<programlisting>void        gda_connection_pool_close_connection
                                            (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             <link linkend="GdaConnection">GdaConnection</link> *cnc);</programlisting>
<para>
Detach a client from the given connection in the specified pool. That
is, it removes the reference from that client to the <link linkend="GdaConnection">GdaConnection</link>
object. From each connection open, the <link linkend="GdaConnectionPool">GdaConnectionPool</link> keeps
a reference count, so that it knows always how many clients are using
each of the <link linkend="GdaConnection">GdaConnection</link> objects being managed by the pool. This way,
it does not actually close the connection until no clients are attached
to it.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pool</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdaConnectionPool">GdaConnectionPool</link> object
</entry></row>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdaConnection">GdaConnection</link> object
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-pool-close-all">gda_connection_pool_close_all ()</title>
<programlisting>void        gda_connection_pool_close_all   (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pool</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdaConnectionPool">GdaConnectionPool</link> object
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdaConnectionPoolForeachFunc">GdaConnectionPoolForeachFunc ()</title>
<programlisting>void        (*GdaConnectionPoolForeachFunc) (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             <link linkend="GdaConnection">GdaConnection</link> *cnc,
                                             const <link linkend="gchar">gchar</link> *gda_name,
                                             const <link linkend="gchar">gchar</link> *username,
                                             const <link linkend="gchar">gchar</link> *password,
                                             <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pool</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>cnc</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>gda_name</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>username</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>password</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gda-connection-pool-foreach">gda_connection_pool_foreach ()</title>
<programlisting>void        gda_connection_pool_foreach     (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *pool,
                                             <link linkend="GdaConnectionPoolForeachFunc">GdaConnectionPoolForeachFunc</link> func,
                                             <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pool</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>func</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>

<refsect1>
<title>Signals</title>
<refsect2><title><anchor id="GdaConnectionPool-open">The &quot;open&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *gdaconnectionpool,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gdaconnectionpool</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GdaConnectionPool-error">The &quot;error&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GdaConnectionPool">GdaConnectionPool</link> *gdaconnectionpool,
                                            <link linkend="gpointer">gpointer</link> arg1,
                                            <link linkend="gpointer">gpointer</link> arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>gdaconnectionpool</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2>
</refsect1>



</refentry>
