We have an application that is using a stateless session bean to call a stored procedure using straight
JDBC.
Sesson bean calls a class which has
connection = getDataSource().getConnection();
Proc = connection.prepareCall(spString);
rs = proc.executeQuery();
The problem is that the none of the data retrieved by the SP is cached at the JVM level. All calls result in a round trip to the database even if the same search is executed twice in a row and brings back the same data each time. This kills performance. I have read some of the posts describing how stored procedures can be called from EJBs i.e stateful beans but it is not clear if the
EJB will cache the results of a stored procedure if the search parameters are the same.
Any suggestions on the best strategy to follow?
The ejb spec is 2.2
The App Server is WebSphere.