Announcement Announcement Module
Collapse
No announcement yet.
[Quartz] JobExecution must already be saved Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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
    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?

    Comment


    • #3
      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.

      Comment

      Working...
      X