in reply to Re: Problem managing persistent database connections in modules
in thread Problem managing persistent database connections in modules

Your reply was helpful. I now have the following to create a singleton database handle.
package MyProject::DbhSingleton; use Apache::Singleton::Request; use base (qw Apache::Singleton::Request); sub _new_instance { my $dbh = DBI->connect($dsn, $user, $pass, $attr) or die DBI->errstr +; }
This would work if I called it within every method (sub) that does database access, but I'm looking for a way to avoid going to that extreme.
  • Comment on Re: Re: Problem managing persistent database connections in modules
  • Download Code