Moi,

a quick question: is it possible to have the 'same' dbh across the apache
children even if you do your best not to?

This minimalistic handler:
use strict;
package Foo;
use Apache::DBI;
use DBI;
use Apache::Constants qw':common';

my $dbh;
$Apache::DBI::DEBUG = 1;

sub handler {
   my $r = shift;
   $r->send_http_header;
   $r->print("ok");
   $dbh ||= DBI->connect("dbi:mysql: ... etc);
   $r->print("dbh: ", $dbh, " ($$)<br>\n");
   return OK;
}
1;

Gives me:
okdbh: Apache::DBI::db=HASH(0x8269a88) (84889)
<reload>
okdbh: Apache::DBI::db=HASH(0x8269a88) (84885)
<reload>
okdbh: Apache::DBI::db=HASH(0x8269a88) (84886)
<reload>
okdbh: Apache::DBI::db=HASH(0x8269a88) (84887)
<reload>
okdbh: Apache::DBI::db=HASH(0x8269a88) (84888)


Is it normal all the $dbh-s have the same 'Apache::DBI::db=HASH(0x8269a88)'
?

Thanks,

Harmen


-- 
                               The Moon is Waning Crescent (43% of Full)

Reply via email to