View Single Post

   
  #3 (permalink)  
Old 02-28-2008, 11:27 AM
mariposas rand mair fheal greykitten tomys des anges
 
Posts: n/a
Default Re: mysql connections vs threads

In article <v07ks4-7oe.ln1@xl.homelinux.org>,
Axel Schwenke <axel.schwenke@gmx.de> wrote:

> mariposas rand mair fheal greykitten tomys des anges <mair_fheal@yahoo.com>
> wrote:
> > if i want to have multiple threads each with its own session-connection
> > dos each one do its own mysql_real_connection for its own connection block?
> >
> > or does one connection represent a block of separate transactions
> > for each thread using it?
> >
> > for example with postgres - each thread requires its own database
> > connection
> > is mysql the same or not?

>
> It's the same. You *can* share a connection between threads, but only
> if you complete the communication cycle from sending the query to
> receiving the EOL packet in the response before you hand the connection
> to another thread. I still don't recommend that. Just one connection
> per application thread (that need the database)


thanks

> Please also read the manual on how to use MySQL from a multithreaded
> application!


would help if i could find it in the manual

arf meow arf - nsa fodder - not just jenine
al qaeda terrorism nuclear bomb iran taliban big brother
if you meet buddha on the usenet killfile him
Reply With Quote