in reply to Re: Cron Jobs and mod_perl...
in thread Cron Jobs and mod_perl...

"why do you need to run it under mod_perl?"

Laziness.

I'd rather keep one module going than split it into two.

I guess I'll just eval the use statements for Apache and Apache::DBI, and rewrite my DB subroutines (lazily written because Apache:DBI takes over connect and disconnect methods - long story....).

Unless anyone has a better idea?

.02

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Re: Cron Jobs and mod_perl...
by CountZero (Bishop) on Dec 14, 2002 at 09:12 UTC

    I always thought that Apache::DBI overloaded the DBI::connect and DBI::disconnect functions to enable persistent connections under mod-perl and did not really change anything how you programmed the DBI-interface. So if you drop all reference to Apache::DBI and use the correct DBI/DBD combo the program should keepon working.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      The point was, since I was using Apache::DBI, I lazily coded the DB methods - ie, connected and disconnected from the DB each time a DB call was made in the script, since I knew Apache::DBI would ignore that and keep the connection open.

      And since some of the cron strips would be running hundreds of DB querires, I wanted to keep that system in place for it, rather than rewriting the module to work well outside of mod_perl...

      .02

      cLive ;-)