code: public List<JobInstance> poll(DbConn cnx, Queue queue, int headSize)
      {
          return JobInstance.select(cnx, "ji_select_poll", queue.getId());
      }
docs: The polling method. Creating "queues" on the different databases can be extremely different in the different supported RDBMS, so this
  method allows to fully change the polling method. <br>
  <br>
  Default implementation uses the ji_select_poll SQL template query and does retrieve the whole queue without using headSize, so is a
  performance waste.
  
  @param cnx
  a session without active TX.
  @param queue
  the queue being polled
  @param headSize
  upper estimate of how many slots are available - i.e. max JI which can be taken from the queue.
  @return a list of JI, or an empty list. Never null.