docs: public final List<PrintJobStatusExtImpl> poll(final int size) {
          final CriteriaBuilder builder = getSession().getCriteriaBuilder();
          final CriteriaQuery<PrintJobStatusExtImpl> criteria =
                  builder.createQuery(PrintJobStatusExtImpl.class);
          final Root<PrintJobStatusExtImpl> root = criteria.from(PrintJobStatusExtImpl.class);
          root.alias("pj");
          criteria.where(builder.equal(root.get("status"), PrintJobStatus.Status.WAITING));
          criteria.orderBy(builder.asc(root.get("entry").get("startTime")));
          final Query<PrintJobStatusExtImpl> query = getSession().createQuery(criteria);
          query.setMaxResults(size);
          // LOCK but don't wait for release (since this is run continuously
          // anyway, no wait prevents deadlock)
          query.setLockMode("pj", LockMode.UPGRADE_NOWAIT);
          try {
              return query.getResultList();
          } catch (PessimisticLockException ex) {
              // Another process was polling at the same time. We can ignore this error
              return Collections.emptyList();
          }
      }