title: HibernateTemplate findByNamedQueryAndNamedParam very slow
body: <p>I am working on a new project on some existing code . It uses <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/orm/hibernate4/HibernateTemplate.html#findByNamedQueryAndNamedParam-java.lang.String-java.lang.String:A-java.lang.Object:A-" rel="nofollow">HibernateTemplate.findByNamedQueryAndNamedParam</a> to invoke a stored procedure in the database . </p>
  
  <p>When I execute the stored procedure on the database , it executes in 2 or 3 seconds . But I execute it via the HibernateTemplate method , it takes anywhere between 2 to 34 minutes . </p>
  
  <p>When I turn showsql on , I see that there are thousands of select statements being triggered . Any pointers on possible reasons for why this could happen . </p>