Here's a rather contrived example:

my $artist = $schema->resultset( 'Artist' )->first;

eval {
    my $guard = $schema->txn_scope_guard;
    $artist->delete;
    die 'rollback!';
    1;
};

#$artist->in_storage(1);
$artist->delete;


Produces:  DBIx::Class::Relationship::CascadeActions::delete(): Not in
database

I'm trying to remember if there's a way to handle code like this.    I came
across it writing tests (where I made some changes, and then rolled back to
revert the changes).  I don't really see that there could be a general way
to handle it, but thought I'd ask.

Is forcing in_storage ok in this case?



-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to