Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

BerkeleyDB::Btree update woes

by bennymack (Pilgrim)
on Oct 16, 2006 at 20:42 UTC ( [id://578588]=perlquestion: print w/replies, xml ) Need Help??

bennymack has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed monks.

As the title suggests, I am currently experiencing extreme difficulties with BerkeleyDB::Btree. I'm hoping it's common enough a module that someone has a recipe for me or can point me to one.

I've basically got a web server that utilizes BDB as an embedded database and separate server processes all access the BDB asynchronously. Now, I need a way to update the BDB periodically from outside of the server processes yet still have them pick up the changes.

While this doesn't sound difficult, what happens is some of the server processes are getting cut-off data when an update is occurring. This becomes painfully obvious when calling Storable::thaw on that cutoff value.

I've tried using DB_INIT_CDB and using cds_lock() but that seems to cause other issues such as freezing.

Please help!

/bennymack

Replies are listed 'Best First'.
Re: BerkeleyDB::Btreee update woes
by perrin (Chancellor) on Oct 16, 2006 at 20:52 UTC
    Letting BerkeleyDB manage the locks is going to give the best performance. You can find various examples on here using Super Search. If you can't get that to work for you, consider using MLDBM::Sync. It doesn't perform as well, but takes a very safe approach.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-24 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found