perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Thomas" <j...@tellme.com>
Subject RE: Apache::DBI patches
Date Tue, 09 Aug 2005 21:32:27 GMT
> While you're at it, can you post 2 separate ones instead of 1.

Here's the first patch.  It moves $Idx from being a file-scoped variable
to connect() scope.  The cleanup handler is then passed a closure
containing $Idx:

	$s->push_handlers("PerlCleanupHandler", sub { cleanup($Idx) });

or

	Apache->push_handlers("PerlCleanupHandler", sub { cleanup($Idx)
});

This makes the cleanup handler work correctly with scripts that use more
than one database handle.  Without it, the second DBI->connect call will
overwrite the initial value of $Idx, so the first handle will never get
properly cleaned up.

Joe

Mime
View raw message