Announcement Announcement Module
No announcement yet.
Is the of late binding commit interval possible? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is the of late binding commit interval possible?

    How to late bind the commit interval?
    Can I do the following:

    <bean id="step"
    class="org.springframework.batch.core.step.item.Si mpleStepFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="jobRepository" ref="jobRepository" />
    <property name="itemReader" ref="itemReader" />
    <property name="itemWriter" ref="rtdsItemWriter" />
    <property name="commitInterval" value="#{jobParameters[commitInterval]}" />
    <property name="itemProcessor" ref="itemProcessor" />


    <job id="ioSampleJob" xmlns="">
    <listener after-job-method="afterJob" before-job-method="beforeJob"
    ref="batchJobListener" />
    <step id="step1" parent="step">
    <tasklet> <chunk reader="itemReader" processor="itemProcessor" writer="rtdsItemWriter" commit-interval="#{jobParameters[commitInterval]}"/>

  • #2
    Not in that form. You can use Spring Expression Language (with Spring 3.0 and the latest Batch) to bind to other objects in the application context, but the jobParameters are not available when the commit-interval is parsed.

    A custom completion policy might work I guess (or even one out of the box). I haven't tried it.

    Please use [code][/code] tags to post code and stacktraces.
    Last edited by Dave Syer; Dec 3rd, 2009, 02:04 PM. Reason: spelling


    • #3
      Thanks Dave for the reply!

      I was trying lot of things to achieve this but in vain and this would me to stop putting my further effort rather futile efforts...

      I think there is a JIRA issue for this new feature addition also if i am right?

      Regards and thanks once again,