code: protected void add(CmsPublishJobInfoBean publishJob) throws CmsException {
  
          // set the queue status in the publish job
          publishJob.enqueue();
  
          // add job to database if necessary
          if (OpenCms.getMemoryMonitor().requiresPersistency()) {
              CmsDbContext dbc = m_publishEngine.getDbContext(null);
              try {
                  // this operation may in rare circumstances fail with a DB exception
                  // if this is the case the publish job must NOT be in the queue
                  m_publishEngine.getDriverManager().createPublishJob(dbc, publishJob);
              } catch (CmsException e) {
                  dbc.rollback();
                  LOG.error(e.getLocalizedMessage(), e);
                  throw e;
              } finally {
                  dbc.clear();
              }
          }
  
          // add publish job to cache
          OpenCms.getMemoryMonitor().cachePublishJob(publishJob);
      }
docs: Pushes a new publish job with the given information in publish queue.<p>
  
  If possible, the publish job starts immediately.<p>
  
  @param publishJob the publish job to enqueue
  
  @throws CmsException if something goes wrong