How does iBatis determine whether results are to be pulled from the cache or to be queried from the database? For instance, if I have a query like such: "select * from employee" and then follow-up with a second query of "select * from employee where id=1", the second query appears to hit the database instead of finding the employee object in the cache with id=1. Is there way to have iBatis get the object from the cached results of the 1st query? Both queries are in the same sqlMap xml have the same result map.
I'm trying to pre-load all employees at web application start so that the first user request (for a given set of employees) doesn't take a hit on response time. Most user requests are for 1-10 employees. Thanks in advance.