Results 1 to 2 of 2

Thread: Passing JobParameters to SimpleStepFactoryBean with Late Binding

  1. #1
    Join Date
    Aug 2010
    Posts
    23

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

    Default

    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.

Tags for this Thread

Posting Permissions

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