[unixODBC-dev] Re: ODBCConfig question

anand.vasudevan at wipro.com anand.vasudevan at wipro.com
Thu Sep 29 16:51:19 BST 2005



Hi Nick,

I had a doubt that if calling SQLDisconnect(dbconhandle) would be
sufficient to disconnect from the datbase or do I need to call
SQLFreeHandle(dbcohandle) to disconnect from the database.

Currently in our application I am just calling SQLDisconnect. Is this
okay?

Thanks in advance.

Cheers,
Anand

-----Original Message-----
From: unixodbc-dev-bounces at easysoft.com
[mailto:unixodbc-dev-bounces at easysoft.com] On Behalf Of Nick Gorham
Sent: Wednesday, September 28, 2005 6:14 PM
To: Development issues and topics for unixODBC
Subject: Re: [unixODBC-dev] Re: ODBCConfig question

anand.vasudevan at wipro.com wrote:
> Hi,
>
> Our application tries to connect to different Ingres databases.
> We get the foll. error: -
>
> "[unixODBC][CA][Ingres ODBC Driver][Ingres]GCC server has exceeded max
> inbound connections."
>
> when our application connects to different databases roughly (15 to
20)
> in a sequential manner.
>
> A typical scenario is
>
> 1. Connect to the database
> 2. Perform necessary insert/delete/update
> 3. Disconnect
>
> The application checks to see if the database is already connected by
> comparing the name of the previously connected database in a C
structure
> and if it does not match then it calls SQLDisconnect.
>
> Thereafter,
>
> SQLAllocHandle(EnvHandle);
> SQLAllocHandle(ConHandle);
> SQLConnect();
>
> After all the table operations are done, it disconnects by calling
> SQLDisconnect.
>
> Should it call SQLFreeHandle(SQL_HANDLE_CON) each time it wants to
> release the connection completely.
>
> Will Connection Pooling help solve the problem? If yes, then should it
> be of type 'SQL_CP_ONE_PER_DRIVER' or 'SQL_CP_ONE_PER_HENV'?
> 

You need to look at what is causing the problem before using pooling.

I would turn on ODBC tracing and check that you are disconnecting.

Also its entirly down to the driver if it actually disconnects.

--
Nick
_______________________________________________
unixODBC-dev mailing list
unixODBC-dev at easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-dev



Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin at wipro.com immediately
and destroy all copies of this message and any attachments.




More information about the unixODBC-dev mailing list