Assuming I never actually call disconnect() and I'm running under Apache 1.3.27, Apache::DBI, and mod_perl 1.27
what could cause this error ?
DBD::Oracle::db prepare failed: ERROR Database disconnected [for statement ``<sql here>''])
I did subclass the DBI module. I did _not_ override the disconnect() method. I did override the connect() method.
package AMSDBI;
our $db_attrs = {RaiseError => 1, PrintError => 0, Taint => 1, AutoCommit => 0};sub connect {
my ($drh, $dsn, $db_user, $db_pass, $db_tracefile, $db_tracelevel, $db_type) = @_;
$AMSDBI::db_attrs->{'RaiseError'} = 0;
my $dbh = $drh->SUPER::connect($dsn, $db_user, $db_pass, $AMSDBI::db_attrs) || &database_connect_failed();
$AMSDBI::db_attrs->{'RaiseError'} = 1;
$dbh->{RaiseError} = 1; $dbh->{odbc_default_bind_type} = SQL_VARCHAR if $db_type =~ /MSSQL/i;
$dbh->{LongReadLen} = 50000;
$dbh->{LongTruncOk} = 1;
$dbh->{ShowErrorStatement} = 1;
$dbh->{ChopBlanks} = 1;
$dbh->{FetchHashKeyName} = "NAME_lc";$dbh->trace($db_tracelevel, $db_tracefile);
return $dbh; }
This error is completely random and only occurs on the above combination AFAIK.
This error is also never the same prepare() that fails. And its not usually any of the first 10 that would run during any giving request.
The SQL is all valid as 98% of the the time everything is fine.
I don't have the trace file handy, but the next time it happens, I can grab it and post it if needed.
