NAME

Paranoid::BerkeleyDB::Db -- BerkeleyDB Db Wrapper

VERSION

$Id: lib/Paranoid/BerkeleyDB/Db.pm, 2.00 2016/05/13 19:47:47 acorliss Exp $

SYNOPSIS

$db = Paranoid::BerkeleyDB::Db->new(-Filename => './dbdir/data.db');

$bdb = $db->db;
$env = $db->env;

DESCRIPTION

This module provides an OO-based wrapper for the BerkeleyDB::Db class. Using this module in lieu of BerkeleyDB directly provides fork-safe operation.

This class places no restrictions on the use of any available BerkeleyDB::Btree options.

SUBROUTINES/METHODS

new

$db = Paranoid::BerkeleyDB::Db->new(-Filename => './dbdir/data.db');

The only required argument is -Filename. For a complete list of all available options please see the document in BerkeleyDB.

By default the following settings are applied unless overridden:

Parameter   Value
---------------------------------------------------
-Flags      DB_CREATE

db

$db = $db->db;

This returns a handle to the current BerkeleyDB::Btree object. Calling this in a child will cause the class to automatically reopen an object to avoid conflicts with the parent process.

env

$env = $db->env;

This returns a handle to the associated Paranoid::BerkeleyDB::Env object, if one is being used.

DESTROY

A DESTROY method is provided which should sync and close an open database, as well as release any locks.

DEPENDENCIES

o

BerkeleyDB

o

Class::EHierarchy

o

Fcntl

o

Paranoid

o

Paranoid::Debug

o

Paranoid::IO

o

Paranoid::IO::Lockfile

BUGS AND LIMITATIONS

-Filename is interpreted differently depending on whether you're using an environment or not. If you're using this module as a standalone DB object any relative paths are interpreted according to your current working directory. If you are using an environment, however, it is interpreted relative to that environment's -Home.

SEE ALSO

L<BerkeleyDB(3)>

HISTORY

02/12/2016 Complete rewrite

AUTHOR

Arthur Corliss (corliss@digitalmages.com)

LICENSE AND COPYRIGHT

This software is licensed under the same terms as Perl, itself. Please see http://dev.perl.org/licenses/ for more information.

(c) 2005 - 2016, Arthur Corliss (corliss@digitalmages.com)