docs: @Override
      public TaskRecord find(long taskId, long partitionId, long maxNextExecTime, boolean forUpdate) throws Exception {
          StringBuilder find = new StringBuilder(237)
                          .append("SELECT t.LOADER,t.OWNR,t.MBITS,t.INAME,t.NEXTEXEC,t.ORIGSUBMT,t.PREVSCHED,t.PREVSTART,t.PREVSTOP,t.RESLT,t.RFAILS,t.STATES,t.TASKB,t.TASKINFO,t.TRIG,t.VERSION FROM Task t WHERE t.ID=:i AND t.PARTN=:p AND t.STATES<")
                          .append(TaskState.SUSPENDED.bit)
                          .append(" AND t.NEXTEXEC<=:m");
  
          final boolean trace = TraceComponent.isAnyTracingEnabled();
          if (trace && tc.isEntryEnabled())
              Tr.entry(this, tc, "find", taskId, partitionId, Utils.appendDate(new StringBuilder(30), maxNextExecTime), forUpdate, find);
  
          EntityManager em = getPersistenceServiceUnit().createEntityManager();
          try {
              TypedQuery<Object[]> query = em.createQuery(find.toString(), Object[].class);
              if (forUpdate)
                  query.setLockMode(LockModeType.PESSIMISTIC_WRITE);
              query.setParameter("i", taskId);
              query.setParameter("p", partitionId);
              query.setParameter("m", maxNextExecTime);
              List<Object[]> resultList = query.getResultList();
              if (resultList.isEmpty()) {
                  if (trace && tc.isEntryEnabled())
                      Tr.exit(this, tc, "find", null);
                  return null;
              }
              Object[] result = resultList.get(0);
  
              TaskRecord taskRecord = new TaskRecord(false);
              taskRecord.setId(taskId);
              taskRecord.setIdentifierOfClassLoader((String) result[0]);
              taskRecord.setIdentifierOfOwner((String) result[1]);
              taskRecord.setIdentifierOfPartition(partitionId);
              taskRecord.setMiscBinaryFlags((Short) result[2]);
              taskRecord.setName((String) result[3]);
              taskRecord.setNextExecutionTime((Long) result[4]);
              taskRecord.setOriginalSubmitTime((Long) result[5]);
              taskRecord.setPreviousScheduledStartTime((Long) result[6]);
              taskRecord.setPreviousStartTime((Long) result[7]);
              taskRecord.setPreviousStopTime((Long) result[8]);
              taskRecord.setResult((byte[]) result[9]);
              taskRecord.setConsecutiveFailureCount((Short) result[10]);
              taskRecord.setState((Short) result[11]);
              taskRecord.setTask((byte[]) result[12]);
              taskRecord.setTaskInformation((byte[]) result[13]);
              taskRecord.setTrigger((byte[]) result[14]);
              taskRecord.setVersion((Integer) result[15]);
  
              if (trace && tc.isEntryEnabled())
                  Tr.exit(this, tc, "find", taskRecord);
              return taskRecord;
          } finally {
              em.close();
          }
      }