cmp_ok($arty->name, 'eq', 'gphat', 'name changed');
# Active: 0 1 2
# Rollback doesn't DESTROY the savepoint, it just rolls back to the value
- # at it's conception
+ # at its conception
$schema->svp_rollback('testing2');
$arty->discard_changes;
cmp_ok($arty->name, 'eq', 'yourmom', 'testing2 reverted');
# And now to see if txn_do will behave correctly
$schema->txn_do (sub {
+ my $artycp = $arty;
+
$schema->txn_do (sub {
- $arty->name ('Muff');
- $arty->update;
+ $artycp->name ('Muff');
+ $artycp->update;
});
eval {
$schema->txn_do (sub {
- $arty->name ('Moff');
- $arty->update;
- $arty->discard_changes;
- is($arty->name,'Moff','Value updated in nested transaction');
+ $artycp->name ('Moff');
+ $artycp->update;
+ $artycp->discard_changes;
+ is($artycp->name,'Moff','Value updated in nested transaction');
$schema->storage->dbh->do ("GUARANTEED TO PHAIL");
});
};
done_testing;
-END { eval { $schema->storage->dbh->do ("DROP TABLE artist") } if defined $schema }
-
+END {
+ eval { $schema->storage->dbh->do ("DROP TABLE artist") } if defined $schema;
+ undef $schema;
+}