Ok, but I don't know how to set up unique handlers for each connection.  Where
can I read how to do this.  I own the Writing Apache Modules with Perl and C,
Advanced Perl, Learning Perl, The UNIX Resource Kit, the Win32 Resource Kit,
Programming Perl and Perl in a Nut Shell with the CD.  So if you can reference
a section in one on these I am willing do my homework.  I just haven't a clue
as to where to look.  :^)

Aaron Johnson

Jeff Beard wrote:

> How 'bout this:
>
> http://perl.apache.org/guide/performance.html#Persistent_DB_Connections
>
> --Jeff
>
> At 04:39 PM 11/27/99 -0500, Aaron Johnson wrote:
> >I am using HTML::Embperl in conjunction with Apache::Session to control
> >session information and create pages.  I have started to create a module
> >that will trim the amount of code and keep a connection with MySQL
> >engine alive.  Below is a section of my module.
> >     My problem is that when I connect again with a different computer my
> >connect all my previous connects are changed to the last one.
> >
> >So in short:
> >
> >Can I assign each session a seperate "permanent" connection?
> >
> >Aaron Johnson
> >
> ># I pass this -> $dbh = db_connect( { database => "$udat{location}",
> >change => 1, } );
> ># for those of you who haven't used HTML::Embperl $udat{location} is
> >session data
> >
> >sub db_connect {
> >  my $pd = shift;
> >  if ($pd->{change}) { &db_disconnect };
> >  if ($pd->{change} || !$dbh) {
> >
> >  $dbh=DBI->connect(
> >     "dbi:mysql:$pd->{database}", 'user', 'password', {
> >          PrintError => 1,
> >                 RaiseError => 1,
> >         }
> >         ) || die $DBI::errstr;
> >
> >  return($dbh)
> >  }
> >
> >  else {
> >   # warn "No need to change!\n";
> >   return($dbh)
> >  }
> >
> >}
>
> Jeff Beard
> Web Systems Engineer
> World Wide Web Associates
> Web: http://wwwa.com
> Phone: 303.545.2399

Reply via email to