hpcc-systems/HPCC-Platform — pull request #1060 by rengolin (2011-11-24 14:44:13+00:00)
Title: Transaction refactoring #1

Rationale:

* Moving sub-classes to top of class to ease calling it from any other function (like promote)
* Splitting the actions (add/del/swap) into *action* and *doAction*, with the latter private
* Action either creates a transaction (that will call doAction) or call it directly
* Still need to clean-up addSubFile of non-doAction stuff
* This is just a step towards always creating the action with auto-commit
* Since doAction don't check for transaction, we don't need to pause the transaction on *run*

Next steps:

* Create a cCreateSuperFileAction and cCreateFileAction that will add the files to the transaction and remove them from the directory on roll-back
* Cleanup addSubfile and doAddSubFile (so it conforms to the rest)
* Make every call within a transaction (local or global) and implement auto-commit for local
* Refactor promoteSuperFile to use files and transaction

All regressions passed. It looks more changes that it really is because of moving classes around. The only changes in the sub-classes are the removal of pause transaction and the use of doActions.

@jakesmith, please have a look too.