There's more than one way to do things | |
PerlMonks |
Re: BerkeleyDB continueby flexvault (Monsignor) |
on Jul 15, 2011 at 13:16 UTC ( [id://914607]=note: print w/replies, xml ) | Need Help?? |
You need to periodically do a 'db_sync()', not just at the end of the program. BerkeleyDB is never in a finished state unless you do a 'db_sync' and then a 'db_close' when you are finished. For performance reasons, BDB only writes the data to disk when the internal buffers are full or when it receives the 'db_sync()'. I guess doing a periodic 'untie' and then 'tie' might work also. I stopped using 'tie' with BerkeleyDB because I didn't have the control over the cache size that you get when you use BerkeleyDB commands directly. If your script runs continuously then you may want to look at 'signals' to help shutdown you application ('db_sync' then 'db_close' or 'untie') before you turn off the computer. Thank you "Well done is better than well said." - Benjamin Franklin
In Section
Seekers of Perl Wisdom
|
|