NAME
BDB::Wrapper Wrapper module for BerkeleyDB.pm
This will make it easy to use BerkeleyDB.pm.
You can protect bdb file from the concurrent access and you can use BerkeleyDB.pm with less difficulty.
Attention: If you use this module for the specified Berkeley DB file, please use this module for all access to the bdb. By it, you can control lock to the bdb file. Lock files are created under /tmp/bdb_home. If you set ram 1 in new option, lock files are created under /dev/shm/bdb_home.
new
Creates an object of BDB::Wrapper
create_env
Creates Environment for BerkeleyDB
This will creates database handler for writing.
$self->create_write_dbh($bdb, {'hash'=>0 or 1, 'dont_try'=>0 or 1, 'sort_code_ref'=>$sort_code_reference, 'sort' or 'sort_num'=>0 or 1, 'reverse_cmp'=>0 or 1, 'reverse' or 'reverse_num'=>0 or 1});
In the default mode, BDB file will be created as Btree;
If you set 'hash' 1, Hash BDB will be created.
If you set 'dont_try' 1, this module won\'t try to unlock BDB if it detects the situation in which deadlock may be occuring.
If you set sort_code_ref some code reference, you can set subroutine for sorting for Btree.
If you set sort or sort_num 1, you can use sub {$_[0] <=> $_[1]} for sort_code_ref.
If you set reverse or reverse_num 1, you can use sub {$_[1] <=> $_[0]} for sort_code_ref.
If you set reverse_cmp 1, you can use sub {$_[1] cmp $_[0]} for sort_code_ref.
This will creates database handler for reading.
$self->create_read_dbh($bdb, {'hash'=>0 or 1, 'dont_try'=>0 or 1, 'sort_code_ref'=>$sort_code_reference, 'sort' or 'sort_num'=>0 or 1, 'reverse_cmp'=>0 or 1, 'reverse' or 'reverse_num'=>0 or 1});
In the default mode, BDB file will be created as Btree;
If you set 'hash' 1, Hash BDB will be created.
If you set 'dont_try' 1, this module won\'t try to unlock BDB if it detects the situation in which deadlock may be occuring.
If you set sort_code_ref some code reference, you can set subroutine for sorting for Btree.
If you set sort or sort_num 1, you can use sub {$_[0] <=> $_[1]} for sort_code_ref.
If you set reverse or reverse_num 1, you can use sub {$_[1] <=> $_[0]} for sort_code_ref.
If you set reverse_cmp 1, you can use sub {$_[1] cmp $_[0]} for sort_code_ref.
This will creates hash for writing.
$self->create_write_hash_ref($bdb, {'hash'=>0 or 1, 'dont_try'=>0 or 1, 'sort_code_ref'=>$sort_code_reference, 'sort' or 'sort_num'=>0 or 1, 'reverse_cmp'=>0 or 1, 'reverse' or 'reverse_num'=>0 or 1});
In the default mode, BDB file will be created as Btree;
If you set 'hash' 1, Hash BDB will be created.
If you set 'dont_try' 1, this module won\'t try to unlock BDB if it detects the situation in which deadlock may be occuring.
If you set sort_code_ref some code reference, you can set subroutine for sorting for Btree.
If you set sort or sort_num 1, you can use sub {$_[0] <=> $_[1]} for sort_code_ref.
If you set reverse or reverse_num 1, you can use sub {$_[1] <=> $_[0]} for sort_code_ref.
If you set reverse_cmp 1, you can use sub {$_[1] cmp $_[0]} for sort_code_ref.
This will creates database handler for reading.
$self->create_read_hash_ref($bdb, 'hash'=>0 or 1, 'dont_try'=>0 or 1, 'sort_code_ref'=>$sort_code_reference, 'sort' or 'sort_num'=>0 or 1, 'reverse_cmp'=>0 or 1, 'reverse' or 'reverse_num'=>0 or 1});
In the default mode, BDB file will be created as Btree;
If you set 'hash' 1, Hash BDB will be created.
If you set 'dont_try' 1, this module won\'t try to unlock BDB if it detects the situation in which deadlock may be occuring.
If you set sort_code_ref some code reference, you can set subroutine for sorting for Btree.
If you set sort or sort_num 1, you can use sub {$_[0] <=> $_[1]} for sort_code_ref.
If you set reverse or reverse_num 1, you can use sub {$_[1] <=> $_[0]} for sort_code_ref.
If you set reverse_cmp 1, you can use sub {$_[1] cmp $_[0]} for sort_code_ref.