1. You're right, there's no any error if the string is removed. If it's
present in startup.pl, then there is no matter if it has any incorrect
record or not - Apache won't start up or restart anyway. I can write any
blah like:

Apache::DBI->connect_on_init("DDDDBI:PgPPPPPP:mypgdb:localhost:5432","XpoYst
Zgres","1my2pw3d");

instead of required and correct data like this:

Apache::DBI->connect_on_init("DBI:PgPP:mypgdb:localhost:5432","postgres","my
pwd");

 Recently, I've tried to follow advices from the Mailing List with Subject
"Preestablish database connection during httpd process startup--HOWTO??". In
my startup.pl I added some strings:

use Apache::DBI ();
use DBI ();
use DBD::PgPP ();

 (by the way, Apache::DBI documentation DOESN'T mentioning about it
explicitly!)
and removed first string (that is necessary for Apache::DBI's work according
to man!):

PerlModule Apache::DBI;

And my server could start successfully. But still there isn't "Preopening
DBI
connection", as any perl-script that accessing DB for the first time has no
ready
(preopened) DB-connection. After the addition of the 'use ... ();' strings
my Apache
could start and mod_perl did work without Apache::DBI->connect_on_init(...)
string
as well as with it! And this string still either might be correct or
incorrect - no matter!
Therefore, I guess it just ignores each time during data compilation or
Apache/mod_perl/
PostgreSQL/DBI/DBD/PgPP's work in spite of there aren't any visible errors.

2. Yes, of course.

3.  "startup.pl syntax OK"

====================================================

 4. Besides that...
 I should reveal you a great secret ;) If there isn't Apache:DBI installed,
then
mod_perl will be keep something like "persistent DBI connection" anyway.
I've
tested it and could see it. I don't know how it actually works, but there
almost wasn't
any visual differences between mod_perl database access working and mod_perl
+
Apache::DBI database access working. Here what I've noticed when running my
perl-scripts in IE6 browser:

mod_perl only:
for the first database access time: access time = 5 sec;
the rest script's restarts:               access time = 0.7 sec;


mod_perl + Apache::DBI:
for the first database access time: access time = 5 sec;
the rest script's restarts:               access time = 0.3 sec.

 As you can see, in the both cases the first database access times are too
long, that
indicates to absence of a preopening DBI connection. Although mod_perl runs
perl-
scripts faster, it must not (or may not?) accelerate database access. It
seems to me,
Apache:DBI is still just taking place on my hard drive with no any profit.
 Also, I can't skip my opinion here: Apache:DBI is BADLY documented, man
seems multi-coloured, non-saying-everything and non-corresponding to
advertised
purpose!

 My httpd.conf is default + mod_perl + Apache:DBI additions, it also
contains

<IfModule mod_perl.c>
    Include conf/perl.conf
</IfModule>

at the end;
perl.conf contains:

PerlRequire "C:/Program Files/Apache Group/Apache2/conf/startup.pl"

#            ??????????????????????????????????
#PerlModule ModPerl::Registry - is it needed???
#            ??????????????????????????????????

# for ModPerl::Registry scripts
Alias /perl/ "C:/Program Files/Apache Group/Apache2/perl/"
<Location /perl>
  SetHandler perl-script
  PerlResponseHandler ModPerl::Registry
  Options +ExecCGI
  PerlOptions +ParseHeaders
  PerlOptions +SetupEnv
</Location>

and startup.pl contains:

#PerlModule Apache::DBI; # useless?

use Apache::DBI ();

##################################### - was borrowed from All-in-One binary
packages of Apache2 + ActivePerl + mod_perl + ssl + php (Randy Kobes)
use ModPerl::Util ();
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::RequestUtil ();
use Apache2::ServerRec ();
use Apache2::ServerUtil ();
use Apache2::Connection ();
use Apache2::Log ();
use Apache2::Const -compile => ':common';
use APR::Const -compile => ':common';
use APR::Table ();
#####################################

use DBI ();              # was recently added
use DBD::PgPP ();  # was recently added

Apache::DBI->connect_on_init
("DBI:PgPP:mypgdb:localhost:5432",
 "postgres",
 "mypwd",
 {
  PrintError => 1, # warn() on errors
  RaiseError => 0, # don't die on error
  AutoCommit => 1, # commit executes immediately
 }
);

$Apache::DBI::DEBUG = 2;

1;

 Also, I want to say that I NEVER use nmake.exe for compiling, istalling,
testing downloaded .pm modules! I use ppm install FOREVER. I niticed,
there's several versions of the same modules, for example, mod_perl.tar.gz
(< 1 Mb, blib directory inside) - it downloads ppm, but also there's
mod_perl-2.0-current.tar.gz (3.5 Mb) - it's not for ppm.


> > Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr);
>
>   So you're saying that you do not receive the error when the above
>   line is not in startup.pl?
>
>   I'm assuming that you have real values for $data_source, $username,
>   $auth, and %attr in your file and not just those variable names?
>
>   Do you receive a different (hopefully more detailed) error when
>   running 'perl -c startup.pl' from the commandline?
>
>  ---------------------------------
>    Frank Wiles <[EMAIL PROTECTED]>
>    http://www.wiles.org
>  ---------------------------------
>
> __________
> http://www.l-trans.ru - çÒÕÚÏÐÅÒÅ×ÏÚËÉ ÐÏ íÏÓË×Å É ÒÅÇÉÏÎÁÍ
Á×ÔÏÔÒÁÎÓÐÏÒÔÏÍ ÏÔ 1,5Ô ÄÏ 20Ô. - ÔÅÌ.8-915-222-04-63
>

Reply via email to