def get_transaction_id(self, app_id, is_xg=False):
    logging.debug("Getting new transaction id for app {0}, with is_xg set " \
      "to {1}".format(app_id, is_xg))

    if self.needs_connection or not self.handle.connected:
      self.reestablish_connection()

    timestamp = str(time.time())

    # First, make the ZK node for the actual transaction id.
    app_path = self.get_txn_path_before_getting_id(app_id)
    txn_id = self.create_sequence_node(app_path, timestamp)

    # Next, make the ZK node that indicates if this a XG transaction.
    if is_xg:
      xg_path = self.get_xg_path(app_id, txn_id)
      self.create_node(xg_path, timestamp)
    logging.debug("Returning transaction ID {0} with timestamp {1} for " \
      "app_id {2}, with is_xg set to {3}".format(txn_id, timestamp, app_id,
      is_xg))
    return txn_id
Construct message used by CtrlServer when replying to list requests.
dataset/ETHPy150Open AppScale/appscale/AppDB/zkappscale/zktransaction.py/ZKTransaction.get_transaction_id--crossover with--dataset/ETHPy150Open IEEERobotics/bot/bot/lib/messages.py/list_reply