PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > mysql connections vs threads
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
mysql connections vs threads

Réponse
 
LinkBack Outils de la discussion
Vieux 23/09/2007, 00h01   #1
mariposas rand mair fheal greykitten tomys des anges
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut mysql connections vs threads

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
  Réponse avec citation
Vieux 24/09/2007, 08h53   #2
Axel Schwenke
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysql connections vs threads

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/
  Réponse avec citation
Vieux 24/09/2007, 11h08   #3
mariposas rand mair fheal greykitten tomys des anges
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 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
  Réponse avec citation
Vieux 24/09/2007, 16h01   #4
Axel Schwenke
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysql connections vs threads

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 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/
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h18.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12564 seconds with 12 queries