On Wed, 24 May 2000, Mark Hewis wrote:
> As far as I have tested under Apache::Registry the following commands have
> the following effect
>
> 1) CORE::exit -> restart all child processes for that server ( a little too
> drastic for me)
that shouldn't happen. it should only kill the kid it was called from.
> 2) exit -> exit code but leave state of all modules the same
>
> What am am really after is an exit which just restarts the child process (it
> is called in) resetting all module globals any suggestions?
exit(-2) will do a graceful exit of the child (unlike CORE::exit), after
logging the transaction is done and connection is closed.
> On a related topic in a given module
>
> BEGIN{} seems to be called only on child initialisation while
> END{} is called at the end of each processed request
>
> This seems a little inconsistant why is this? Can this behaviour be changed?
>
> Because of this
>
> close_everything() in END{} in BerkeleyDB.pm is called after each request
> destroying any ties or environments open which for me is not good.
see mod_perl.pod and chapter 9 of the eagle book for BEGIN/END details.
the solution for you would be to load BerkeleyDB at startup, in which
case, END is not called until the child exits.