begin_work, rollback, and commit now properly lock the database
[dbsrgits/DBM-Deep.git] / t / 41_transaction_multilevel.t
index f06b2eb..d125582 100644 (file)
@@ -13,7 +13,7 @@ my $db1 = DBM::Deep->new(
     autoflush => 1,
     num_txns  => 2,
 );
-seek $db1->_get_self->_storage->{fh}, 0, 0;
+seek $db1->_get_self->_engine->storage->{fh}, 0, 0;
 
 my $db2 = DBM::Deep->new(
     file => $filename,
@@ -27,6 +27,7 @@ $db1->{x} = { xy => { foo => 'y' } };
 is( $db1->{x}{xy}{foo}, 'y', "Before transaction, DB1's X is Y" );
 is( $db2->{x}{xy}{foo}, 'y', "Before transaction, DB2's X is Y" );
 
+#warn $db1->_dump_file;
 $db1->begin_work;
 
     cmp_bag( [ keys %$db1 ], [qw( x )], "DB1 keys correct" );
@@ -48,8 +49,9 @@ $db1->begin_work;
     cmp_bag( [ keys %{$db1->{x}} ], [qw( yz )], "DB1->X keys correct" );
     cmp_bag( [ keys %{$db2->{x}} ], [qw( xy )], "DB2->X keys correct" );
 
+#warn $db1->_dump_file;
 $db1->rollback;
-
+__END__
 cmp_bag( [ keys %$db1 ], [qw( x )], "DB1 keys correct" );
 cmp_bag( [ keys %$db2 ], [qw( x )], "DB2 keys correct" );
 
@@ -94,5 +96,5 @@ cmp_bag( [ keys %{$db2->{x}} ], [qw( yz )], "DB2->X keys correct" );
 cmp_bag( [ keys %{$db1->{x}{yz}} ], [qw( bar )], "DB1->X->XY keys correct" );
 cmp_bag( [ keys %{$db2->{x}{yz}} ], [qw( bar )], "DB2->X->XY keys correct" );
 
-$db1->_get_self->_storage->close( $db1->_get_self );
-$db2->_get_self->_storage->close( $db2->_get_self );
+$db1->_get_self->_engine->storage->close( $db1->_get_self );
+$db2->_get_self->_engine->storage->close( $db2->_get_self );