Results 1 to 3 of 3

Thread: Is the of late binding commit interval possible?

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Bangalore
    Posts
    7

    Default 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. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    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 at 01:04 PM. Reason: spelling

  3. #3
    Join Date
    May 2008
    Location
    Bangalore
    Posts
    7

    Default

    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

Posting Permissions

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