rjb has asked for the wisdom of the Perl Monks concerning the following question:
and the only place it is used is a lookup:my $env = new BerkeleyDB::Env -Flags => DB_CREATE | DB_INIT_CDB |DB_IN +IT_MPOOL, -Home => '/etc/postfix/policydb'; my (%domains); my $db = tie %domains,"BerkeleyDB::Hash", -Filename=> DOMAIN_FILE, -Flags=> DB_CREATE, -Mode => 0660, -Env=> $env or syslog 'error', "Can't open DB_File ". DOMAIN_FILE .": $!";
And an add if the domain wasn't found:return $domains{$domain} if ($domains{$domain});
Any suggestions would be greatly appreciated.# Add to the berkeleydb unless some other process has already done i +t unless($domains{$domain}) { my $lock=$db->cds_lock(); $domains{$domain}=$return; $db->db_sync(); $lock->cds_unlock(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory problems with BerkeleyDB
by TOD (Friar) on Aug 19, 2007 at 01:06 UTC | |
|
Re: Memory problems with BerkeleyDB
by Anonymous Monk on Aug 19, 2007 at 02:12 UTC |