RE: BerkeleyDB error

"Peram, Sudhakara" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <1AB4528DFFE18144962BB7139C3357C304001C2F@ndhamrexm51.amer.pfizer.com>
Thanks Jim!


--Sudhakar

-----Original Message-----
From: Jim Schueler [mailto:[email protected]] 
Sent: Monday, January 03, 2011 10:47 PM
To: Peram, Sudhakara
Cc: [email protected]
Subject: RE: BerkeleyDB error

The following line needs to be added to httpd.conf

   PerlChildExitHandler Apache::ChildExit

The handler is called when a process is shut down, regardless of which
handlers were called during the process's lifetime.  So this line should
not be inside a directive block.

The module documentation says that Apache::Registry evals the BEGIN {}
blocks only once and evals the END {} blocks every time the
Apache::Registry handler is called.  I originally determined this by
observation- it may also be documented.

Apache::ChildExit::Postpone() moves the END {} blocks from an internal
perl stack to a vector private to Apache::ChildExit.  The handler then
executes those blocks when the process is terminated.  Thus, the
Postpone() method is specifically intended for Apache::Registry.  If
other handlers do a better job alternating BEGIN {} blocks with END {}
blocks, those handlers should never encounter the Postpone() method.  If
the
Postpone() method is used correctly this way, the Apache::ChildExit
handler should be compatible with all your other configured handlers.

BerkeleyDB handles are typically closed in an END {} tag.  But in
Apache::Registry, these handles are still available to subsequent
handler calls.  Because the BerkeleyDB close() command performs cache
flushing and similar housekeeping, subsequent operations on a db handle
don't flush correctly, which ultimately leads to file corruption.

Let me know-

Jim

> Thanks Jim.
> 
> I am bit novice to mod_perl and apache, below is my httpd.conf 
> configuration. Can you please let me know how to use Apache::ChildExit

> module if you have free time.
> 
> Where xxxx is our application name.
> 
> Thank you once again for your help!
> 
> --Sudhakar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.