Hello.

 Before Apache::DBI installation I'd using just DBI & PgPP for
connecting with my PostgreSQL DataBase:

$user = "owner";
$password = "pwd";
$data_source = "dbi:PgPP:mypgdb;localhost;5432";
$dbh = DBI->connect($data_source, $user, $password);
$sth = $dbh->prepare( q{ SELECT ... FROM ... });
$rc = $sth->execute;

 Then I've installed Apache::DBI and modified my httpd.conf. In fact,
all the connections to DataBase from the same Perl-scripts became
persistent and now total script's work is faster excepting all its
initial runnings. For solving this I'd follow the example from the
mod_perl mans located here (Preopening DBI connections):
../Apache2/modperl/docs/1.0/guide/databases.html#Preopening_DBI_connections

  Apache::DBI->connect_on_init
  ("DBI:mysql:myDB:myserver",
   "username",
   "passwd",
   {
    PrintError => 1, # warn() on errors
    RaiseError => 0, # don't die on error
    AutoCommit => 1, # commit executes immediately
   }
  );

strings were added in the startup.pl and the

  "DBI:mysql:myDB:myserver"

string was modified to the

  "dbi:PgPP:mypgdb:localhost:5432"

 After server's restart it couldn't to start up actually. The
error.log said the following:

[Fri Nov 11 21:35:09 2005] [notice] Parent: Received restart signal --
Restarting the server.
[Fri Nov 11 21:35:09 2005] [notice] Child 1008: Exit event signaled. Child
process is ending.
[Fri Nov 11 21:35:10 2005] [notice] Child 1008: Released the start mutex
[Fri Nov 11 21:35:12 2005] [error] Can't load Perl file: C:/Program
Files/Apache Group/Apache2/conf/startup.pl for server localhost:80,
exiting...
[Fri Nov 11 21:35:12 2005] [notice] Child 1008: Waiting for 250 worker
threads to exit.
[Fri Nov 11 21:35:12 2005] [notice] Child 1008: All worker threads have
exited.
[Fri Nov 11 21:35:12 2005] [notice] Child 1008: Child process is exiting

 The server's name in the "[error]" string corresponds to the
ServerName's value of my httpd.conf.

 Is there a way to do the Preopening DBI connections just
for a PostgreSQL DataBase with Apache::DBI?

 Thanx.

Reply via email to