Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: sharing DBMs

by mp (Deacon)
on Oct 02, 2002 at 15:59 UTC ( [id://202301]=note: print w/replies, xml ) Need Help??


in reply to sharing DBMs

I don't fully understand your question, but MLDBM::Sync will handle DBM locking for you.

Replies are listed 'Best First'.
Re: Re: sharing DBMs
by marvell (Pilgrim) on Oct 04, 2002 at 12:48 UTC
    Having read more into it, it appears my question is:

    Is there a perl module that allows you to us the concurrent data model (many read, one write) model for Berkeley DB in a tie way?

    That is to say, as one process writes, the other can read and it's there.

    --
    Steve Marvell

      After reading more, and playing, here it is:

      #!/usr/bin/perl -w use strict; use BerkeleyDB; use Data::Dumper; my $env = new BerkeleyDB::Env( -Home => '/home/steve/test', -Flags => DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL ) || die "env error: $! $BerkeleyDB::Error"; my $db = (tie my %hash, 'BerkeleyDB::Hash', -Filename => 'db2.bdb', -Env => $env, -Flags => DB_CREATE) || die "db error: $! $BerkeleyDB::Error"; while (<>) { $hash{$1} = $2 if (/(.*)=(.*)/); print Dumper \%hash; } undef $db; untie %hash;

      --
      Steve Marvell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://202301]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found