perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Ochs" <>
Subject BerkeleyDB with mod perl
Date Thu, 22 Apr 2004 19:55:47 GMT
I know this isn't exactly mod perl specific, but since there isn't a mailing
list for BerkeleyDB and this is an issue I know people using BerkeleyDB and
mod perl have probably run accross I thought I would post it here.

I'm using the latest BerkeleyDB perl module on freebsd 5.2 with mod perl
1.xx.  Following is the BerkeleyDB code I am using.  When I start running
lots of concurrent processes that run db_put I get the error 'Locker does
not exist' in $BerkeleyDB::Error and db_put returns 'Invalid argument'.   I
must be setting up the environment incorrectly somehow.  I am trying to use
the BerkeleyDB concurrent data store mode which I assumed would handle all
the locking for me.

my %Cache;
my $env = new BerkeleyDB::Env(
      -Home  => '/tmp/bdb',
      or die "can't create BerkelyDB::Env: $!";

  my $bdb = tie %Cache, 'BerkeleyDB::Hash',
     -Filename => '/tmp/bdb/bdbfile',
     -Flags    => DB_CREATE,
     -Mode     => 0640,
     -Env      => $env
     or die ("Can't tie to /tmp/bdb/bdbdfile: $!");

My db_put looks like this:
my $status = $bdb->db_put($key,$value);


Report problems:
Mail list info:
List etiquette:

View raw message