Results 1 to 3 of 3

Thread: [Quartz] JobExecution must already be saved

  1. #1
    Join Date
    Nov 2008
    Posts
    14

    Default [Quartz] JobExecution must already be saved

    Hi,

    I encounter a problem using Quartz and Spring batch.
    3 different recurring jobs are running at the same time (with SimpleAsyncTaskExecutor). I'm using the in-memory MapJobRepositoryFactoryBean

    Frequently one of the following two errors occurs:
    Code:
    Exception in thread "SimpleAsyncTaskExecutor-45" java.lang.IllegalArgumentException: JobExecution must already be saved
    	at org.springframework.util.Assert.notNull(Assert.java:112)
    	at org.springframework.batch.core.repository.dao.MapJobExecutionDao.updateJobExecution(MapJobExecutionDao.java:80)
    	at org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:231)
    Code:
    java.lang.IllegalArgumentException: step executions for given job execution are expected to be already saved
    	at org.springframework.util.Assert.notNull(Assert.java:112)
    	at org.springframework.batch.core.repository.dao.MapStepExecutionDao.updateStepExecution(MapStepExecutionDao.java:90)
    	at org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:264)
    Configuration used:
    - Spring 2.5.5
    - Spring batch 2.0.0 CI SNAPSHOT
    - Quartz 1.6.4

    It is probably a conflict about jobRepository access by many threads, but I am not able to diagnostic the problem. Please let me know if you have any advice.

    Thank you in advance,
    Matthias.

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

    Default

    I don't think it's possible to diagnose without at least some more of the stack traces. Is there some reason why you have to use the map Daos? If you switch to the Jdbc* versions is there still a problem?

  3. #3
    Join Date
    Nov 2008
    Posts
    14

    Default

    Thanks for your reply.

    As you said, I am now using SimpleJobRepository.
    Actually I was not using it to avoid the storage of large amount of batch meta-data and as a consequence database accesses.

    Best regards,
    Matthias.

Posting Permissions

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