From: Warren Young Date: March 5 2009 3:52pm Subject: Re: Confirmation about thread un-safety/safety List-Archive: http://lists.mysql.com/plusplus/8438 Message-Id: <49AFF53A.4090508@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jim Wallace wrote: > I know you can't use the same connection object on different threads. I don't think that's true, as stated. What you can't do is use a single connection object for two different queries at once. This issue really has nothing to do with threads: http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html#concurrentqueries Threads just make it harder to avoid running into this limitation. > It looks like I can 't do query.store() on one thread and > query.store_next() on another since it calls > conn_->driver()->next_result(); Did you try it and find that it fails, or are you just avoiding it because you think it won't work? If the latter, try it anyway. Obviously due to the simultaneous query issue, you do have to avoid making another query on that connection until the second thread has finished consuming the results. If you were hoping to avoid this, perhaps so you could have one thread processing results while another starts new queries, then you do indeed need at least two Connections.