code: protected boolean shouldCommitDuringPrepare(PrepareCommand command, TxInvocationContext ctx) {
        return totalOrder ?
               command.isOnePhaseCommit() && (!ctx.isOriginLocal() || !command.hasModifications()) :
               command.isOnePhaseCommit();
     }
docs: total order condition: only commits when it is remote context and the prepare has the flag 1PC set
  
  @param command the prepare command
  @param ctx the invocation context
  @return true if the modification should be committed, false otherwise