code: static void updateNodeConfiguration(String nodeName, DbConn cnx, int port)
      {
          // Node
          Integer nodeId = null;
          try
          {
              nodeId = cnx.runSelectSingle("node_select_by_key", Integer.class, nodeName);
          }
          catch (NoResultException e)
          {
              jqmlogger.info("Node " + nodeName + " does not exist in the configuration and will be created with default values");
  
              nodeId = Node.create(cnx, nodeName, port, System.getProperty("user.dir") + "/jobs/", System.getProperty("user.dir") + "/jobs/",
                      System.getProperty("user.dir") + "/tmp/", "localhost", "INFO").getId();
              cnx.commit();
          }
  
          // Deployment parameters
          long i = cnx.runSelectSingle("dp_select_count_for_node", Integer.class, nodeId);
          if (i == 0L)
          {
              jqmlogger.info("As this node is not bound to any queue, it will be set to poll from the default queue with default parameters");
              Integer default_queue_id = cnx.runSelectSingle("q_select_default", 1, Integer.class);
              DeploymentParameter.create(cnx, nodeId, 5, 1000, default_queue_id);
  
              cnx.commit();
          }
      }
docs: Creates or updates a node.<br>
  This method makes the assumption metadata is valid. e.g. there MUST be a single default queue.<br>
  Call {@link #updateConfiguration(EntityManager)} before to be sure if necessary.
  
  @param nodeName
  name of the node that should be created or updated (if incompletely defined only)
  @param em
  an EntityManager on which a transaction will be opened.