private static byte[] generateGTid() {
    // Asif: The counter should be attached to the string inside Synch block
    StringBuilder sbuff = new StringBuilder(getId());
    synchronized (GlobalTransaction.class) {
      if (mCounter == 99999) {
        mCounter = 1;
      } else {
        ++mCounter;
      }
      sbuff.append(mCounter);
    }
    sbuff.append('_').append(System.currentTimeMillis());
    byte[] byte_array = sbuff.toString().getBytes();
    return byte_array;
  }
Returns a byte array which uses a static synchronized counter to ensure uniqueness
geode-core/src/main/java/org/apache/geode/internal/jta/GlobalTransaction.java