Hi, I am using Hibernate 2.1.7 and I noticed a weird behavior. I query a database using sess.createQuery(hql).setLong(0, parameter).list() and it is taking a long time, then I replaced it for sess.find(hql, new Object[] {parameter}, new Type[] {Hibernate.Long}) and it still took a long time. When I created I a hard coded string (hql) with the parameters and called sess.find(hql) the result was extremely fast, something like 100 times faster! Does anyone have an explanation for this?
Thanks in advance.
|