Announcement Announcement Module
Collapse
No announcement yet.
New method request to StepExecutionDao Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • New method request to StepExecutionDao

    Hi,
    Could you please add a new method to StepExecutionDao as below, to return the steps executions for a given jobExecution

    public List<StepExecution> findStepExecutions(JobExecution jobExecution);

    I can extend StepExecutionDao and create a class and add it. But I thought this might be needed for others as well.

  • #2
    It's already there:

    Code:
    	/**
    	 * Retrieve all the {@link StepExecution} for the parent {@link JobExecution}.
    	 * 
    	 * @param jobExecution the parent job execution
    	 */
    	void addStepExecutions(JobExecution jobExecution);

    Comment


    • #3
      Dave,
      Thanks for the reply.
      But 'addStepExecutions' does not return anything, also the method name indicates a different purpose right?

      I would need a similar method which returns a 'List<StepExecution>'

      Comment


      • #4
        The step executions are part of the JobExecution. See JobExecution.getStepExecutions().

        Comment


        • #5
          My requiremet is, I have details of a job execution, say id. Now I want to get the step execution. With the out of box DAO's I can load, JobExecution object back. But it won't load the step excutions.
          Or am I missing something?

          Comment


          • #6
            I think you are missing something. Did you try the addStepExecutions() method and it didn't work?

            Comment


            • #7
              This is what I have in JdbcStepExecutionDao:addStepExecutions

              Code:
              public void addStepExecutions(JobExecution jobExecution)
                {
                  getJdbcTemplate().query(getQuery("SELECT STEP_EXECUTION_ID, STEP_NAME, START_TIME, END_TIME, STATUS, COMMIT_COUNT, READ_COUNT, FILTER_COUNT, WRITE_COUNT, EXIT_CODE, EXIT_MESSAGE, READ_SKIP_COUNT, WRITE_SKIP_COUNT, PROCESS_SKIP_COUNT, ROLLBACK_COUNT, LAST_UPDATED, VERSION from %PREFIX%STEP_EXECUTION where JOB_EXECUTION_ID = ? order by STEP_EXECUTION_ID"), new StepExecutionRowMapper(jobExecution), new Object[] { jobExecution.getId() });
                }
              Here we just perform the query. But never returns the results.
              If you could return the results, my problem would be solved.
              Last edited by Devadasan; Mar 20th, 2009, 06:56 AM.

              Comment


              • #8
                Did you try looking at the jobExecution.getStepExecutions()?

                (Please use [code][/code] tags to post code and stack traces.)

                Comment


                • #9
                  Infact my creation of the jobs, steps etc...happens as part of different process.
                  I wanted to create a set of jsps to display the details of various jobs, steps etc.

                  So in other words, I am trying retrieve and display the already persisted step execution information. So all the jobs, steps information are only in database, not in memory.

                  What I have in my hand is just a jobexecutionid.

                  This is where I have the problem.

                  Comment


                  • #10
                    I don't understand. Are you saying this doesn't work?

                    Code:
                    JobExecution jobExecution = jobExecutionDao.getJobExecution(id);
                    stepExecutionDao.addStepExecutions(jobExecution);
                    List<StepExecution> stepExecutions = jobExecution.getStepExecutions();
                    There is even a convenience wrapper in JobExplorer.getJobExecution() that does the same thing (and sets the JobInstance up as well).

                    Comment


                    • #11
                      Cool, JobExplorer.getJobExecution() worked.
                      Thanks for your patience!

                      For the first point.
                      Suppose we have already persisted a set of jobs, steps etc.
                      For eg, say I have one jobexecution record, and 5 step execution records in the database.
                      Now if I do,
                      Code:
                      JobExecution jobExecution = jobExecutionDao.getJobExecution(id);
                      List<StepExecution> stepExecutions = jobExecution.getStepExecutions();
                      I would have expected to get 5 records in the list stepExecutions. But this was not happening; since we are not doing
                      Code:
                      getJobExecutionDependencies(jobExecution);
                      as we do in JobExplorer.

                      Comment

                      Working...
                      X