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

David Cantrell david at cantrell.org.uk
Wed Mar 27 12:30:03 GMT 2013


On Wed, Mar 27, 2013 at 06:02:27AM +1100, Peter Rabbitson wrote:

> From https://metacpan.org/module/DBIx::Class::Row#delete
> :: If you delete an object within a txn_do() (see "txn_do" in 
> :: DBIx::Class::Storage) and the transaction subsequently fails, the 
> :: result object will remain marked as not being in storage. If you know 
> :: for a fact that the object is still in storage (i.e. by inspecting 
> :: the cause of the transaction's failure), you can use 
> :: $obj->in_storage(1) to restore consistency between the object and the 
> :: database. This would allow a subsequent $obj->delete to work as 
> :: expected.

Eeuuww!

I would thunk that in_storage should be "rolled back" too.

-- 
David Cantrell | Cake Smuggler Extraordinaire

Computer Science is about lofty design goals and careful algorithmic
optimisation.  Sysadminning is about cleaning up the resulting mess.



More information about the DBIx-Class mailing list