Never? Never is a very big word.
If you're in a transaction, it doesn't matter what the timer interrupts and it will all be left in a predictable state. Tools like
DBIx::Class with
DBIx::Class::Storage::TxnScopeGuard and perhaps
Sys::SigAction make things like what the OP requested semitrivial.
Don't give generic, half-right advice; fixing the issue is indeed the best thing to do here. Give 100% on-point advice with working code or don't participate.
|