you have an error in your algebra. !(B || C) == !B && !C

btw, ```(shouldInvokeRemoteTxCommand || prepareSent) && !isOnePhaseCommit``` does not look correct to me because when you have one phase commit, the rollback is never sent!