Subject: | $row->delete after failed transaction |
If a row is deleted inside a transaction and that transaction
subsequently fails, one cannot delete the row with the delete() method.
For example:
$schema->txn_do( sub {
$row->delete; # this works
die; # cancel the transaction with an exception
});
$row->delete; # this dies with "Not in storage"
Deleting $row inside the transaction calls $row->in_storage(undef).
However, when the transaction is rolled back $row is not marked as being
back in storage. Ideally, I think it should be.
I've been working around this with something like:
$schema->resultset('RowClass')->search({ id => $row->id })->delete;
which generates the same resulting SQL but is not nearly as concise.