11 messages in com.mysql.lists.perlRe: multiples statement handlers ($st...
FromSent OnAttachments
Raul Dias20 Jul 2001 10:48 
Robert Goff20 Jul 2001 13:41 
Jochen Wiedmann21 Jul 2001 03:08 
Jochen Wiedmann21 Jul 2001 03:11 
Raul Dias21 Jul 2001 06:38 
Robert Goff22 Jul 2001 14:26 
Robert Goff22 Jul 2001 14:28 
Jochen Wiedmann23 Jul 2001 02:30 
Raul Dias23 Jul 2001 16:16 
Rajeev Rumale26 Jul 2001 02:08 
Jochen Wiedmann26 Jul 2001 02:11 
Subject:Re: multiples statement handlers ($sth) together
From:Jochen Wiedmann (jo@ispsoft.de)
Date:07/23/2001 02:30:57 AM
List:com.mysql.lists.perl

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