List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:August 3 2012 8:05pm
Subject:Re: connection list problems
View as plain text  
On 8/3/2012 12:58 PM, Bernd Prager wrote:
> void Dal::putConnection(boost::any connection) {
>      if((int)connectionPool.size() == connectionPoolMax) {
>          // pool is full
>          boost::lock_guard<boost::mutex> lock(mutex);
>          destroyConnection(connection);
>      }
>      connectionPool.push_back(connection);
> }

Explain to me how this doesn't insert destroyed connections into the 
pool when you hit the pool's size limit.

Another likely problem is that this looks like it will create value 
copies of the Connection objects, which causes MySQL DB server 
re-connection.  You'd do better here to use reference semantics.
connection list problemsBernd Prager3 Aug
  • Re: connection list problemsWarren Young3 Aug
    • Re: connection list problemsBernd Prager3 Aug