When use the tasklet's transaction-manager attribute?
Hello Guys
I have mostly the follow configuration
Code:
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<property name="dataSource" ref="dataSource" />
</bean>
<batch:job-repository id="jobRepository"
data-source="dataSource"
transaction-manager="transactionManager"
isolation-level-for-create="SERIALIZABLE"
table-prefix="BATCH_"
/>
And
Code:
<import resource="classpath:/jobs/definitions/beans/job-*-beans.xml"/>
<batch:job id="simpleErrorChunk0203ImportDataJob"
job-repository="jobRepository"
>
<batch:step id="clienteStep" >
<batch:tasklet >
<batch:chunk reader="clienteErrorChunk0203FlatFileItemReader"
writer="clienteJdbcBatchWriter"
commit-interval="50"/>
</batch:tasklet>
</batch:step>
</batch:job>
I have the same behavior if I add:
Code:
<import resource="classpath:/jobs/definitions/beans/job-*-beans.xml"/>
<batch:job id="simpleErrorChunk0203ImportDataJob"
job-repository="jobRepository"
>
<batch:step id="clienteStep" >
<batch:tasklet transaction-manager="transactionManager">
<batch:chunk reader="clienteErrorChunk0203FlatFileItemReader"
writer="clienteJdbcBatchWriter"
commit-interval="50"/>
</batch:tasklet>
</batch:step>
</batch:job>
1) So why and when I should use the tasklet's transaction-manager attribute?
2) Am I missing something?
3) has sense include this attribute for all my Step's tasklets?
Thanks in advanced