For finder methods on the dao's supported by GenericDaoHibernateImpl, GenericDaoHibernateImpl does not properly close the connection.
For example, if you have an interface:
Code:
public interface MyDao extends GenericDao<MyObject, Long> {
List<MyObject> findByStr(String value);
}
The method on GenericDaoHibernateImpl that supports the findByStr is:
Code:
public List<T> executeFinder(Method method, final Object[] queryArgs) {
final Query namedQuery = prepareQuery(method, queryArgs);
return (List<T>) namedQuery.list();
}
I don't see where the session gets closed?
What's the best way to solve this problem or am I missing something fundamental?
Michael