-
Dec 3rd, 2009, 09:32 AM
#1
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>
-
Dec 3rd, 2009, 01:03 PM
#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 at 01:04 PM.
Reason: spelling
-
Dec 4th, 2009, 12:02 AM
#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
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