Guyz,
We are facing extremely slow performance with jdbctemplate.query whereas the usual plain jdbc statements brings the records at once.
Blow is our code which tries execute simple select statement without any conditions.
-------------------------------------------
System.out.println(new Date()+"-Before creating JdbcTemplate instance");
JdbcTemplate jt = new JdbcTemplate(getDataSource());
System.out.println(new Date()+"-After creating JdbcTemplate instance and Before executing jt.query");
List MrpList = jt.query(MrpConstants.MRP_DATA_VW, new MrpMapper());
System.out.println(new Date()+"-After jt.query:"+MrpList.size());
OrganizationMaintenanceDTO[] retMrp = new OrganizationMaintenanceDTO[MrpList
.size()];
if (MrpList.size() > 0)
{
for (int i = 0; i < MrpList.size(); i++)
{
System.out.println(new Date()+"-After jt.query: looping records:"+i+1);
retMrp[i] = (OrganizationMaintenanceDTO) MrpList.get(i);
}
}
-------------------------------------------
20,000 records - 2 hrs
Wed Jul 10 11:09:29 EDT 2007-Before creating JdbcTemplate instance
Wed Jul 10 11:09:29 EDT 2007-After creating JdbcTemplate instance and Before executing jt.query
Wed Jul 10 13:12:20 EDT 2007-After jt.query:20551
------------------------------------
1400 records - 11 mins
Wed Jul 11 12:15:29 EDT 2007-Before creating JdbcTemplate instance
Wed Jul 11 12:15:29 EDT 2007-After creating JdbcTemplate instance and Before executing jt.query
Wed Jul 11 12:26:20 EDT 2007-After jt.query:1448
------------------------------------
Any help?
Thanks,
Nambi


Reply With Quote