ISPN-3556: Reorder the affectedKeys member so any exceptions thrown don't affect rollback of locked keys.