6
unless(grep /blib/, @INC) {
8
@INC = '../lib' if -d '../lib';
17
my $Dfile = "dbhash.tmp";
23
# let object destruction kill everything
25
my $lex = new LexFile $Dfile ;
29
ok 1, my $lexD = new LexDir($home) ;
30
ok 2, my $env = new BerkeleyDB::Env -Home => $home,
31
-Flags => DB_CREATE|DB_INIT_TXN|
32
DB_INIT_MPOOL|DB_INIT_LOCK ;
33
ok 3, my $txn = $env->txn_begin() ;
34
ok 4, my $db1 = tie %hash, 'BerkeleyDB::Hash', -Filename => $Dfile,
39
ok 5, $txn->txn_commit() == 0 ;
40
ok 6, $txn = $env->txn_begin() ;
51
while (my ($k, $v) = each %data) {
52
$ret += $db1->db_put($k, $v) ;
56
# should be able to see all the records
58
ok 8, my $cursor = $db1->db_cursor() ;
59
my ($k, $v) = ("", "") ;
62
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
68
# now abort the transaction
69
ok 10, $txn->txn_abort() == 0 ;
71
# there shouldn't be any records in the database
74
ok 11, $cursor = $db1->db_cursor() ;
75
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
89
my $lex = new LexFile $Dfile ;
92
my ($k, $v) = ("", "") ;
93
ok 13, my $db1 = tie %hash, 'BerkeleyDB::Hash',
98
ok 14, $cursor = $db1->db_cursor() ;
99
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {