AESYS S.p.A. [Enzo Arlati] wrote:
I get an application with several thread , with each thread using it's own
connection.
What I mean is that the thread create a connection at the beginning and
close and detroy it before it close.

Under some circustances some of these threads close itself and reopen after
few minutes ( for example 60 secs. ).

I don't really see the meaning of a thread that close itself and reopen... If the thread return or die, you should explicitely close the connection, if the thread is just sleeping, there is nothing to do, just check the connection when the thread wake up.



When this appened also if the connection is closed , it is still registered
as active by mysql.

Then the connection is not properly close, and the thread still active somewhere (in sleep ?) ;)


So I got that each time a new thread is started a new connection is added to
the list of mysql connection.
When the thread  died , mysql keep a reference to an idle connection until
the wait_timeout expiration time.

So I must keep the value of  wait_timeout  lower , ie. = 120, while the
preferred value should higher that this value.

There are some way to shorten the timeout for removing the connections
without interfere with the timeout used for still active connection ?


I'm using mdac with c++buider 6 and the way I create and destroy the connection are showed belowe:

is mdac you database layer ?


/********************************************************/
void __fastcall TDataModule_PMV::RemoveMyConnection(TMyConnection * dbConn)
{
       if( dbConn )
       {
         dbConn->Connected = false;
         delete dbConn;
         dbConn = 0;
       }
}

Does this mean that it will close the connection ?

--
Philippe Poelvoorde
COS Trading Ltd.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to