List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:July 23 2001 9:31am
Subject:Re: multiples statement handlers ($sth) together
View as plain text  
Robert Goff wrote:

>>Having different $dbhs for each thread means that I would need
>>to connect to the database in each thread, right? Can't I have
>>different $dbh's sharing the same connection?
>>
> 
> A $dbh, the return value of the DBI->connect() method, is mapped one-to-one
> with a database connection.  As far as I know, there is no way to have two
> separate $dbh objects without two separate database connections.


Thats correct. Using one dbh per thread is definitely recommended.
With MySQL it is no problem to connect/disconnect. Besides, you
can always use a connection pool via connect_cached.


Bye,

Jochen


Thread
multiples statement handlers ($sth) togetherRaul Dias20 Jul
  • RE: multiples statement handlers ($sth) togetherRobert Goff20 Jul
    • Re: multiples statement handlers ($sth) togetherJochen Wiedmann21 Jul
      • RE: multiples statement handlers ($sth) togetherRobert Goff22 Jul
  • Re: multiples statement handlers ($sth) togetherJochen Wiedmann21 Jul
Re: multiples statement handlers ($sth) togetherRaul Dias21 Jul
  • RE: multiples statement handlers ($sth) togetherRobert Goff22 Jul
    • Re: multiples statement handlers ($sth) togetherJochen Wiedmann23 Jul
    • connection pool via connect_cachedRajeev Rumale26 Jul
    • Re: connection pool via connect_cachedJochen Wiedmann26 Jul
Re: multiples statement handlers ($sth) togetherRaul Dias24 Jul