Announcement Announcement Module
Collapse
No announcement yet.
Passing JobParameters to SimpleStepFactoryBean with Late Binding Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Passing JobParameters to SimpleStepFactoryBean with Late Binding

    Is there a way I can parameterize commitInterval in SimpleStepFactoryBean bean definition ?

    I tried the configuration below with no luck -


    <bean id="baseProcessingStep" scope="step"
    class="org.springframework.batch.core.step.item.Si mpleStepFactoryBean"
    abstract="true">
    <property name="transactionManager" ref="transactionManager" />
    <property name="jobRepository" ref="jobRepository" />
    <property name="startLimit" value="100" />
    <property name="commitInterval" value="#{jobParameters[commitInterval]}" />
    </bean>

    I keep getting -

    Invalid property 'targetBeanName' of bean class [org.springframework.batch.core.configuration.xml.S tepParserStepFactoryBean]: Bean property 'targetBeanName' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

    Thanks.

  • #2
    You can't use scope="step" on a Step, unless it is wrapped in another Step (the scope instance has to be created by a Step). Another way to set the commit interval like that is to use StepExecutionSimpleCompletionPolicy.

    Comment

    Working...
    X