Results 1 to 2 of 2

Thread: Retrieving ExecutionContext

  1. #1

    Default Retrieving ExecutionContext

    Hi, I have question about retrieving ExecutionContext. If some job is successfully finished (of failed does not matter) and after that following code is executed:
    Code:
           JobRepository jobRepository = (JobRepository) applicationContext
    		.getBean("jobRepository");
    
    	boolean jobExists = jobRepository.isJobInstanceExists(job.getName(),
    		jobParameters);
    
    	if (jobExists) {
    	    JobExecution jobExecution = jobRepository.getLastJobExecution(job
    		    .getName(), jobParameters);
    
    	    jobExecution.getExecutionContext() //this is empty
            }
    and ExecutionContext is empty although data is in database.

    Is there any way for me to retrieve data from batch_job_execution_context table?

    Thanks, Ivica.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    You are probably using 1.1.x? You can use a JobExecutionListener, or hold on to a reference to the JobExecution in your JobLauncher client.

    In 2.0 you can use JobExplorer to get the JobExecution by ID from the database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •