Announcement Announcement Module
Collapse
No announcement yet.
Is the of late binding commit interval possible? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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" />
    </bean>



    OR,

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

  • #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, 01:04 PM. Reason: spelling

    Comment


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

      http://jira.springframework.org/browse/BATCH-1396

      Regards and thanks once again,
      Sanjeev

      Comment

      Working...
      X