On 7/12/07, Nils Kaiser <[EMAIL PROTECTED]> wrote:
To achieve full performance, I read
that it better to tie the berkeleyDB once and reuse the handle for each
request, i.e. having the tie command outside of the mod_perl handler.

Yes.  If you really are concerned with performance, don't use the tie
API at all.  Use the OO methods (get, put) directly.

Has someone example code to do that?

If this is read/write, you need to use the BerkeleyDB::Env stuff.  If
you google a little you should find some examples.  I know I've put a
few here and on perlmonks.org.

I can imagine how to tie on startup, but how to trigger the code for
untie at shutdown? Is untie needed at all with berkeleyDB?

Yes, do the untie to flush buffers to disk.  The appropriate place to
do this is the PerlChildInitHandler and PerlChildExitHandler.  Do not
try to open it in the parent process.

- Perrin

Reply via email to