in reply to DBI vs Apache::DBI

As other monks have mentioned, Apache::DBI is only for use with mod_perl, where it provides persistent database connections between runs of the script. While it has been a while since I have used mod_perl, I remember that Apache::DBI is supposed to transparently replace DBI when loaded and should be loaded via the server configuration. In other words, scripts should never use Apache::DBI; explicitly, and you should change the offending script to use DBI;.

Replies are listed 'Best First'.
Re^2: DBI vs Apache::DBI
by DaisyLou (Sexton) on Aug 23, 2019 at 23:15 UTC

    Yes, it's running under mod-perl. Should I change it to DBI or DBIx::Connector as the original responder suggested?

      As I understand, Apache:DBI is supposed to be loaded in the mod_perl configuration, not in the script. If Apache::DBI is loaded, use DBI; actually gives you Apache::DBI and its extra feature of connection caching. In all cases, the script should "use DBI;".

      If you want to use DBIx::Connector, you will need to read the documentation and possibly change more than just a use line in your script. I have not used it and I do not know about it.