-
Aug 10th, 2010, 09:12 AM
#1
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.
-
Aug 11th, 2010, 01:46 AM
#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.
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
-
Forum Rules