perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Ochs" <ch...@paymentonline.net>
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',
      -Flags => DB_INIT_CDB | DB_CREATE | DB_INIT_MPOOL,
      )
      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);

Chris


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message