vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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? 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 |
| |||
| 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) Please also read the manual on how to use MySQL from a multithreaded application! XL -- Axel Schwenke, Support Engineer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ |
| |||
| 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 |
| ||||
| mariposas rand mair fheal greykitten tomys des anges <mair_fheal@yahoo.com> wrote: > In article <v07ks4-7oe.ln1@xl.homelinux.org>, > Axel Schwenke <axel.schwenke@gmx.de> wrote: > >> Please also read the manual on how to use MySQL from a multithreaded >> application! > > would help if i could find it in the manual http://dev.mysql.com/doc/refman/5.0/...d-clients.html XL -- Axel Schwenke, Support Engineer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ |