Announcement Announcement Module
Collapse
No announcement yet.
JobExecution Is Always 0? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JobExecution Is Always 0?

    Hi,

    I have a integration test using JobLauncherTestUtils to launch a job. However, each time I evaluate the Id of jobExecution, it returns 0:

    Code:
            
    JobExecution jobExecution = jobLauncherTestUtils.launchJob(params);
    
    System.err.println(jobExecution.getId()); // 0?!
    My job interally captures the job execution id for logging purposes, but the simple snippet always returns 0 and I don't understand why.

    Thanks,

    Alejandro

  • #2
    How are you launching the job? If you are creating a new process each time and using the Map based JobRepository, you'd get 0 every time because the id isn't persistent from run to run.

    Comment


    • #3
      Bah! After looking at my config again, that is exatcly what is happening. I had a test context for batch that brought in a Map based repo.

      Thanks,

      Alejandro

      Comment

      Working...
      X