31 |
require WAIT::Parse::Base; |
require WAIT::Parse::Base; |
32 |
|
|
33 |
use strict; |
use strict; |
34 |
use Carp; |
use Carp qw(cluck croak); |
35 |
# use autouse Carp => qw( croak($) ); |
# use autouse Carp => qw( croak($) ); |
36 |
use BerkeleyDB; |
use BerkeleyDB; |
37 |
use Fcntl; |
use Fcntl; |
410 |
my $flags; |
my $flags; |
411 |
if ($self->{mode} & O_RDWR) { |
if ($self->{mode} & O_RDWR) { |
412 |
$flags = DB_CREATE; # | DB_INIT_MPOOL | DB_PRIVATE | DB_INIT_CDB; |
$flags = DB_CREATE; # | DB_INIT_MPOOL | DB_PRIVATE | DB_INIT_CDB; |
413 |
warn "Flags on table $path set to 'writing'"; |
#warn "DEBUG: Flags on table $path set to 'writing'"; |
414 |
} else { |
} else { |
415 |
$flags = DB_RDONLY; |
$flags = DB_RDONLY; |
416 |
# warn "Flags on table $path set to 'readonly'"; |
#warn "DEBUG: Flags on table $path set to 'readonly'"; |
417 |
} |
} |
418 |
unless (defined $self->{dbh}) { |
unless (defined $self->{dbh}) { |
419 |
my $subname = $self->tablename . "/records"; |
my $subname = $self->tablename . "/records"; |
567 |
my $key = shift; |
my $key = shift; |
568 |
|
|
569 |
unless ($key) { |
unless ($key) { |
570 |
Carp::cluck "Warning: delete_by_key called without key. Looks like a bug in WAIT?"; |
cluck "Warning: delete_by_key called without key. Looks like a bug in WAIT?"; |
571 |
return; |
return; |
572 |
} |
} |
573 |
|
|
640 |
sub close { |
sub close { |
641 |
my $self = shift; |
my $self = shift; |
642 |
|
|
643 |
require Carp; Carp::cluck("------->Closing A Table<-------"); |
#cluck("DEBUG: Closing A Table"); |
644 |
|
|
645 |
if (exists $self->{'access'}) { |
if (exists $self->{'access'}) { |
646 |
eval {$self->{'access'}->close}; # dont bother if not opened |
eval {$self->{'access'}->close}; # dont bother if not opened |
672 |
untie %{$self->{db}}; |
untie %{$self->{db}}; |
673 |
for my $att (qw(env db path maindbfile)) { |
for my $att (qw(env db path maindbfile)) { |
674 |
delete $self->{$att}; |
delete $self->{$att}; |
675 |
warn "----->Deleted att $att<-----"; |
#cluck "DEBUG: Deleted att $att"; |
676 |
} |
} |
677 |
|
|
678 |
1; |
1; |
752 |
$cont = $query->{cont}; |
$cont = $query->{cont}; |
753 |
$raw = $query->{raw}; |
$raw = $query->{raw}; |
754 |
} else { |
} else { |
755 |
require Carp; |
cluck("Using three argument search interface is deprecated, use hashref interface instead"); |
|
Carp::cluck("Using three argument search interface is deprecated, use hashref interface instead"); |
|
756 |
$attr = shift; |
$attr = shift; |
757 |
$cont = shift; |
$cont = shift; |
758 |
$raw = shift; |
$raw = shift; |