hey tom!it works like this:prevayler makes the copy of the system only before the first transaction and after a failing transaction.
pseudocode:
if (foodtaster == null)
foodtaster = copyKing();
if (execute action on foodtaster fails)
foodtaster = null;
else
execute action on king
regards chris
Chris,
Thanks, I understand better now.
I'm suggesting:
if (king == null)
king = loadKingAndRollForward(); // that is, restore from the persistent store
if (execute action on king fails)
king = null;
So you don't have to execute an action twice, and you don't use as much memory, but you do need to do a reload instead of a copy when a transaction fails.
I imagine that reloading is more expensive than copying?