Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Poor man's transaction construct

by aquarium (Curate)
on Nov 24, 2010 at 22:01 UTC ( #873542=note: print w/replies, xml ) Need Help??


in reply to Re^2: Poor man's transaction construct
in thread Poor man's transaction construct

the rollback should die if a step dies..or you will quite possibly be undoing things that cannot be undone if the prior (undo) step failed. automatically undoing with commands like "rm -r -f dirname" should not (in my opinion) be ever run automatically, and as part of an undo sequence even more dangerous.
i think it is a bit ambitious to be constructing code to automatically undo other code. the original (non-undo) code fails for some unknown reason, which was not catered for in the code...so how does one then produce undo code that should be even more robust?
also the entire undo sequence does not need to follow exactly every step of normal run code. if the normal code creates a db, then creates tables, and then populates those..the undo should be merely a drop db. so if you absolutely must write this code, by grouping certain steps linked to a single undo step, it will be more robust by virtue of fewer undo steps code to run.
the hardest line to type correctly is: stty erase ^H

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://873542]
help
Chatterbox?
[LanX]: it's sometimes useful in P5 too
[LanX]: but I don't understand the question...
[GotToBTru]: okay, I see what it does
[GotToBTru]: you;ve answered it .. the expression is meant to be evaluated as written, it is not a symbol for a special operation
[LanX]: '&;@' is a parsing error
[GotToBTru]: by itself, yes, but used in sub pre(&;@) not so
[LanX]: &; is interpreted as a function call, but the @ has no meaning
[LanX]: OH
[LanX]: you are talking about signatures?
[GotToBTru]: yes, it turns out I am

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-01-18 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (164 votes). Check out past polls.