You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Gunnar Koppel <gu...@raamatukoi.ee> on 2004/08/24 11:59:07 UTC

[mp1] END failed under PerlRun

Terr!

While ago i migrated my scripts from CGI-environment to the PerlRun and 
now i see in my error.log such messages:

--
Can't call method "disconnect" on an undefined value at /adm/tellimus 
line 1105.
END failed--call queue aborted.
--

Background:
In my scripts i use BEGIN and END blocks, so BEGIN contains code for 
connect with database and END for disconnect (END doesn't contain 
anything else, BEGIN has more initializing stuff).

Sample code:

BEGIN {
use DBI;
$db = "db";
$user = "user";
$password = "pwd";
$hostname = "localhost";
$data_source = "DBI:mysql:$db";
$dbh = DBI->connect($data_source, $user, $password) || die "VIGA\n";
}

END {
$rc = $dbh->disconnect;
}

This messages in error.log does not appear on every invocation but 
randomly. I don't see those messages for script in which i moved 
disconnect to the logical end point. Maybe someone can point out, why it 
happens with END-block?

My system is Debian GNU/Linux Stable, Apache is 1.3.29, mod_perl 1.29,
perl 5.8.3.

-- 

TIA,

WK



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] END failed under PerlRun

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2004-08-24 at 05:59, Gunnar Koppel wrote:
> This messages in error.log does not appear on every invocation but 
> randomly. I don't see those messages for script in which i moved 
> disconnect to the logical end point. Maybe someone can point out, why it 
> happens with END-block?

There's nothing in your code here that would cause it.  The END block
runs when the apache child process is shut down, but that should be
fine.  My guess is that you lost your connection somewhere along the
line.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html