Hi,

I am using jdbcTemplate which is inserted into Itemwriter. Below is the configuration. the time it is taking to update 100 records is around 2 mins. But with out Spring batch using simple spring with jdbcTemplate is getting these records updated in less than 20 seconds.

Is there anything I am missing in setting the transaction or anything that is causing this delay in the DB update. Also somewhere I saw that new ApplicationContext is created every time that piece of code was called. I am not sure if that is causing me the problem.

I am using CommandLineJobRunner for running the application.
-----------------------------------
<bean id="jdbcTemplate" class ="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg index="0" type="javax.sql.DataSource">
<ref local = "datasource" />
</constructor-arg>
</bean>

<bean id="writer" class="com.fileloader.writer.TransactionWriter" >
<property name = "transactionTemplate" >
<ref local = "transactionTemplate" />
</property>
<property name ="jdbcTemplate"><ref bean = "jdbcTemplate" /></property>
</bean>


public void write(final List<? extends TransactionBean> tBeans) throws Exception {

try{
transactionTemplate.execute(new TransactionCallback() {
public Object doInTransaction(TransactionStatus status) {
for (TransactionBean tBean : tBeans) { jdbcTemplate.update(tBean.getSqlString() , tBean.getSqlValues());
}
return null;
}
});
}
catch (Exception e)
{
e.printStackTrace();
}
}

------------

Advanced thanks

Thanks