Loading...
If the page contents do not appear, it may mean that JavaScript is disabled in your browser. Please enable JavaScript to view this.
Single-threaded simplistic undoable/rollbackable transactions in PerlAaron's Perl Transaction Module Photo: Kolob Wild RoseIPv4You are not logged in. Click here to log in. | |
Simplistic Single-Threaded Transactions in Perl Back in 2001, I wrote a simplistic module in Perl for InfoWest, Inc.. The module was designed to make it easy to undo or rollback a series of actions should a failure or error or unavailable resource mean the set of tasks couldn't be completed. InfoWest used (and still uses) it in various systems administrative tasks and applications where a series of actions need be fully undoable should one component of the complete task fail for some reason. I called the module a transaction module even though it really just emulates something similar to true transactions, and is limited due to its simplistic, single-threaded design. There is no documentation except for the comments in the source file. The module does require the Error.pm Perl module for try/catch exception handling. The mechanism for implementing actions that can be rolled back or undone is a simple stack onto which anonymous subroutines are pushed which act as closures upon transaction commitment or rollback. These are not database transactions, and the user of the module has to implement the anonymous closures that "undo" or "rollback" the actions taken. Without any further comment, here's the file: | |
Copyright © 1993-2010 - Aaron D. Gifford - All Rights Reserved | |