17 |
use strict; |
use strict; |
18 |
use BerkeleyDB; |
use BerkeleyDB; |
19 |
use Fcntl; |
use Fcntl; |
20 |
|
use Carp; |
21 |
use vars qw($VERSION); |
use vars qw($VERSION); |
22 |
|
|
23 |
$VERSION = "2.000"; # Table.pm tests if we are loaded by checking $VERSION |
$VERSION = "2.000"; # Table.pm tests if we are loaded by checking $VERSION |
137 |
|
|
138 |
sub sync { |
sub sync { |
139 |
my $self = shift; |
my $self = shift; |
140 |
$self->{dbh}->sync if $self->{dbh}; |
#warn "DEBUG: sync dbh[$self->{dbh}]"; |
141 |
|
if ($self->{dbh}) { |
142 |
|
unless (defined($self->{dbh}->db_sync)) { |
143 |
|
carp "sync failed: $BerkeleyDB::Error"; |
144 |
|
} |
145 |
|
} else { |
146 |
|
confess "sync called without dbh"; |
147 |
|
} |
148 |
} |
} |
149 |
|
|
150 |
sub close { |
sub close { |