Results 1 to 6 of 6

Thread: Can we have a new api in JobInstanceDao

  1. #1

    Default Can we have a new api in JobInstanceDao

    Hi,

    I saw the api of JobInstanceDao and try to get the JobInstance by calling getJobInstance(Job job, JobParameters jobParameters). In this way, I must know the JobParameter, however, we do not know job parameters when people monitor their job which was run by spring batch automatically, and they only know the name of job.
    the steps I want to do to monitor a batch job are
    • query all job instances according to job name,
    • get a job instance object according to job_instance_id
    • query the job status, step status for a certain job instance


    I take a look at the table BATCH_JOB_INSTANCE and I notice that we can get JobInstance by passing JOB_INSTANCE_ID, that becomes more easy since we do not need to remember job parameters.

    Could we provide this API
    Code:
    List getJobInstances(String jobname, int maxReturnNumber)
    and
    Code:
    JobInstance getJobInstance(String JOB_INSTANCE_ID)
    in the next version of spring batch?
    Last edited by veaven; Aug 25th, 2008 at 05:31 AM.
    David Yinwei Liu

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

    Default

    Take a look at JobExplorer in the latest snasphots, or in SVN. That should give you what you want.

  3. #3

    Default

    thanks Dave. That is exactly what I want! I just notice that you add it into 2.0 a cuple days ago.
    David Yinwei Liu

  4. #4

    Default

    Hi Dave,
    another query, could we have another api to remove old job instances from repository? or this api already in the plan?
    David Yinwei Liu

  5. #5
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    It's not. And I'm reluctant to add it really. The whole point of the batch meta data is that you have the whole history of a job, and it isn't part of the framework to be able to remove that. Try telling your auditors that you don't know what your system is doing because you deleted the data.
    Last edited by Dave Syer; Aug 26th, 2008 at 01:39 AM. Reason: spelling

  6. #6

    Default

    make sense. thanks, Dave.
    David Yinwei Liu

Posting Permissions

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