On Jun 27, 2011, at 1:13 PM, Fred Moyer wrote:
> Wow, that's obnoxious:
>
> 1237 if ($INC{'Apache/DBI.pm'} && $ENV{MOD_PERL}) {
> 1238 $old_connect_via = $DBI::connect_via;
> 1239 $DBI::connect_via = 'connect';
> 1240 }
DBIx::Connector does the same thing.
> And it is also apparently not working as they expected:
>
> [Mon Jun 27 13:05:17 2011] [notice] Apache/2.2.17 (Unix)
> mod_apreq2-20090110/2.8.0 mod_perl/2.0.5 Perl/v5.12.3 configured --
> resuming normal operations
> 8879 Apache::DBI new connect to 'dbname='...
>
> In my startup.pl (My::Model is DBIx::Class based):
>
> $Apache::DBI::DEBUG = 2;
> my $db_connect_params = My::Model->connect_params;
> Apache::DBI->connect_on_init( @{$db_connect_params} );
> Apache::DBI->setPingTimeOut( $db_connect_params->[0], 5 );
>
> # delete this line and I will beat you with a stick (note to self)
> My::Model->connect->disconnect;
> $DBI::connect_via = 'Apache::DBI::connect';
You lost me. But really, I strongly recommend against the use of Apache::DBI.
Some discussion here:
http://search.cpan.org/dist/DBIx-Connector/lib/DBIx/Connector.pm#Description
Best,
David