use strict;
use warnings FATAL => 'all';
+no warnings 'recursion';
-our $VERSION = q(1.0019_002);
+our $VERSION = q(1.0019_003);
use Scalar::Util ();
my $class = shift;
my $args = $class->_get_args( @_ );
my $self;
-
+
if (defined($args->{type}) && $args->{type} eq TYPE_ARRAY) {
$class = 'DBM::Deep::Array';
require DBM::Deep::Array;
*lock = \&lock_exclusive;
sub lock_shared {
my $self = shift->_get_self;
+use Carp qw( cluck ); use Data::Dumper;
+cluck Dumper($self) unless $self->_engine;
return $self->_engine->lock_shared( $self, @_ );
}
__PACKAGE__->_throw_error( "Unknown type for '$value'" );
}
- if ( eval { local $SIG{__DIE__}; $tied->isa( __PACKAGE__ ) } ) {
+ if ( eval { local $SIG{'__DIE__'}; $tied->isa( __PACKAGE__ ) } ) {
${$spot} = $tied->_repr;
$tied->_copy_node( ${$spot} );
}
$self->lock_exclusive;
$self->_engine->clear_cache;
$self->_copy_node( $db_temp );
+ $self->unlock;
$db_temp->_engine->storage->close;
undef $db_temp;
}
sub clone {
- ##
- # Make copy of object and return
- ##
my $self = shift->_get_self;
return __PACKAGE__->new(
sub begin_work {
my $self = shift->_get_self;
$self->lock_exclusive;
- my $rv = eval { $self->_engine->begin_work( $self, @_ ) };
+ my $rv = eval {
+ local $SIG{'__DIE__'};
+ $self->_engine->begin_work( $self, @_ );
+ };
my $e = $@;
$self->unlock;
die $e if $e;
sub rollback {
my $self = shift->_get_self;
+
$self->lock_exclusive;
- my $rv = eval { $self->_engine->rollback( $self, @_ ) };
+ my $rv = eval {
+ local $SIG{'__DIE__'};
+ $self->_engine->rollback( $self, @_ );
+ };
my $e = $@;
$self->unlock;
die $e if $e;
sub commit {
my $self = shift->_get_self;
$self->lock_exclusive;
- my $rv = eval { $self->_engine->commit( $self, @_ ) };
+ my $rv = eval {
+ local $SIG{'__DIE__'};
+ $self->_engine->commit( $self, @_ );
+ };
my $e = $@;
$self->unlock;
die $e if $e;
}
eval {
+ local $SIG{'__DIE__'};
$self->_engine->write_value( $self, $key, $value );
}; if ( my $e = $@ ) {
$self->unlock;
}
$self->lock_exclusive;
-
- $engine->clear;
+ eval {
+ local $SIG{'__DIE__'};
+ $engine->clear( $self );
+ };
+ my $e = $@;
+ warn "$e\n" if $e;
$self->unlock;
+ die $e if $e;
+
return 1;
}