docs: int completeTransaction(Xid xid, boolean commit) {
        try {
           TransactionOperationFactory factory = assertStartedAndReturnFactory();
           CompleteTransactionOperation operation = factory.newCompleteTransactionOperation(xid, commit);
           return operation.execute().get();
        } catch (Exception e) {
           getLog().debug("Exception while commit/rollback.", e);
           return XAException.XA_HEURRB; //heuristically rolled-back
        }
     }