[Dbix-class] DBIx::Class::Relationship::CascadeActions::delete(): Not in database

Bill Moseley moseley at hank.org
Tue Mar 26 05:51:50 GMT 2013


Here's a rather contrived example:


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

eval {
    my $guard =3D $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
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20130325/d09=
a9a67/attachment.htm


More information about the DBIx-Class mailing list