hpcc-systems/HPCC-Platform — pull request #1179 by rengolin (2012-01-03 18:54:51+00:00)
Title: Common up lock/unlock of files within actions

Transaction execution no longer calls lock/unlock directly, but through
the public helpers prepare/retry/commit/rollback. This avoids confusion
on transaction's code about commit/rollback duality and common up the
locking and unlocking of resources on a seamless way.

The constructor was also moved inside CDFAction to ease understanding,
and a mistake was fixed on cCreateSuperFileAction's prepare, where the
file was being added to the directory even if not created locally.

**Possible problem:** on ```unlock()```, if ```unlockTransaction()``` throws an exception, the clear will not take place until the destructor. However, on exception, the transaction will roll back, which will unlock the files again (and possibly throw again), but still, all will be cleared and the actions destroyed.

I'm not seeing any dead lock possibilities here, since it would have occurred during lock, not unlock, and at the end of the roll back, all resources will be freed.

@jakesmith, please take a look.