On Oct 1, 2010, at 7:20 AM, Hossein Younesi wrote:
> I assumed that destructor will close the connection automatically!
Why assume? You have the source code. (And yes, it does.)
Are you sure all Connection objects are being destroyed correctly?
Also, the other respondent brought up another possibility, that more connections are open
at a given time than the MySQL server allows. That doesn't necessarily indicate that
connections are never being closed, just that too many are being established. It may be
that the proper fix is to keep connections open longer, and reuse them.
Are you using ConnectionPool? If not, why not?