[Persistence] Revert quick-fix for persistence clearing

Revert "Squashed commit of the following:"

This reverts commit d1c01d3c86.
This commit is contained in:
Victor Woeltjen
2016-07-14 11:51:59 -07:00
parent cd21575546
commit eb5493e37b
4 changed files with 3 additions and 65 deletions

View File

@ -140,38 +140,9 @@ define(
});
};
/**
* Clear and restart the active transaction.
*
* This neither cancels nor commits the active transaction;
* instead, it returns a function that can be used to cancel that
* transaction.
*
* @returns {Function} a function to cancel the prior transaction
* @private
*/
TransactionService.prototype.restartTransaction = function () {
var oldOnCancels = this.onCancels;
this.onCommits = [];
this.onCancels = [];
return function () {
while (oldOnCancels.length > 0) {
var onCancel = oldOnCancels.pop();
try {
onCancel();
} catch (error) {
this.$log.error("Error cancelling transaction.");
}
}
};
};
TransactionService.prototype.size = function () {
return this.onCommits.length;
};
return TransactionService;
}
);
});