I'm writing a script that will run under mod_perl that uses DBI to connect
to an MS SQL server.  The script works fine and mod_perl speeds it up quite
a bit.  Every so often, when the script tries to connect to the SQL server,
the connection times out (I think the SQL server's a little slow), and I get
an Internal Server Error message.  My problem is that, instead of trying to
connect to the server again, the next time the script is run, the database
connection handle stays the same and I get the following error in my logs
over and over again "Can't call method "quote" on an undefined value" (the
first thing the script does is a $dbh->quote of a variable).  The code that
does the connection to the database is in a module that is used by the
script, but not in a subroutine.

So, how can I have it try to connect to the database again if it fails, but
keep the connection persistent if it doesn't?  Would there be some way to
have the script exit completely when it gets an error like that, even though
it's under mod_perl?

Thanks!

Curtis H.


Reply via email to