Spandana Anand

Greenhorn
+ Follow
since Jun 26, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Spandana Anand


Dear All,

We have migrated a Struts application into Spring. We only used Spring JDBC module. My application earlier when developed through Struts used to take just 10 seconds to login. But now in Spring, it is taking more than four minutes. We are unable to make out the reason. Could anyone of you throw a light on the reasons why this application became slow?

Any suggestion to improvise is welcome...

Thanks in advance!!

11 years ago
hi I am implementing rest services using spring 3 and also for data fetching using jdbctemplate.
Currently i have to fetch a record from customer table based upon a customer id passed.

For same i have used : jdbcTemplate.query(SqlQueries.SQL_SELECT_CUSTOMER_ BY_TOKEN, new Object[]{customerToken}, new CustomerExtractor());

CustomerExtractor is a private class implementing ResultSetExtractor

code snippet:

private class CustomerExtractor implements ResultSetExtractor<Customer> {

@Override
public Customer extractData(ResultSet rs) throws SQLException,
DataAccessException {

Customer customer = null;
if(rs.next()){
customer = new Customer();
//populate customer
}
return customer;
}

PS - customer with provided id may or may not exist.


Here when I access rest service using web browser , i don;t get valid customer even if customer id sent as pathVariable is correct.
Upon debugging i found that debug pointer does not go inside the if(rs.next()){} block

There is nothing wrong in query it works fine in mysql workbench.

Also I implemented rest client using apacheHttpClient now when i used this test class to test restservice i got valid response from service

Upon debugging i found that debug pointer goes inside the if(rs.next()){} block



kindly explain why there is such strange behaviour that when accessed via browser i don't get valid response and when tested via test class I get a valid response.
11 years ago