List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:July 11 2014 6:33pm
Subject:Re: Problem with attempt to share a Connection between threads
View as plain text  
On Jul 11, 2014, at 10:54 AM, Damien Kick <dkick@stripped> wrote:

> <http://youtu.be/ri3aL8At44I?t=1m25s>
> 
> Yes, if I use a Connection per thread, then I avoid any threading issues associated
> with sharing a Connection between threads.

This is an open-source project.  I regularly accept outside patches.  If you think the
library should allow arbitrary sharing of Connection objects among threads, jump into the
library and figure out why it is not currently possible, and provide a patch.

Until then, “So don’t do that, then” is a perfectly reasonable answer.

> But I was under the impression that sharing a Connection object between threads
> should be okay.

Only in strictly limited ways.

The underlying MySQL C API library will not allow two simultaneous queries on a single
connection — lowercase “C”.  Thus, if you have no way to mediate access
to the Connection object — such as a ConnectionPool — you’re likely to
run into trouble.

> (Assume I know nothing […])
> 
> Fair enough.  Anybody else?

Are you aware that you’re corresponding with the person who has been maintaining
MySQL++ for the past decade?

Not only do I know more about how MySQL++ works than probably anyone else on the planet,
I’m also in the best position to help you.  You may have noticed that you have not
yet been inundated with other offers of help.

So…how about you can the snark?
Thread
Problem with attempt to share a Connection between threadsDamien Kick10 Jul 2014
  • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014
    • Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
      • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014
        • Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
          • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014
            • Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
              • Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
                • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014
              • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014
                • Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
                  • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014
                    • Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
                      • Re: Problem with attempt to share a Connection between threadsAdrian Cornish11 Jul 2014
  • Re: Problem with attempt to share a Connection between threadsChris Frey13 Jul 2014
Re: Problem with attempt to share a Connection between threadsDamien Kick11 Jul 2014
  • Re: Problem with attempt to share a Connection between threadsWarren Young11 Jul 2014