I have multiple mod_perl applications running within one Apache instance.  For 
most of these applications, I want to use Apache::DBI, but I want to disable it 
for just one.  According to various Web pages, this is not possible, because 
Apache::DBI attaches itself to all DBI->connect() calls.  I would have to run 
my app in a separate Apache instance that excludes Apache::DBI.

It looks like it actually is possible to disable Apache::DBI.  Apache::DBI will 
not be used for a specific DBI connection if its DBI->connect() has a special 
value set for the dbi_connect_method attribute, as in:

        $dbh = DBI->connect('dbi:...', '...', '...', { dbi_connect_method => 
'connect' } );

Could somebody verify that this is a sane and future-proof approach?

>From my reading of the DBI.pm source code, this works because DBI defaults to 
>using its own connect() method, then switches to Apache::DBI::connect() if 
>Apache::DBI is in use, and finally, looks for the "dbi_connect_method" 
>attribute.  By setting this attribute to the original default, "connect", 
>Apache::DBI is neatly bypassed.

This would be more elegant if a future version of DBI were to include support 
for a "disable_apache_dbi" attribute.  I think this might involve just a simple 
addition to DBI::connect().

Ted Behling, ISP Systems Analyst
Hargray Communications
[EMAIL PROTECTED]

Reply via email to