Thank you Warren. I see your points.
-- Bernd
Sent from my iPhone
On Aug 3, 2012, at 4:05 PM, Warren Young <mysqlpp@stripped> wrote:
> 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.
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe: http://lists.mysql.com/plusplus
>