anthony wrote:
search the forum for this kind of question.
Trust me, I did. Don't know if I'm searching on the wrong key words, but nothing useful came up.
The main issue here is that I can run the same query that hibernate is spitting out in less than a second through the SQL Server GUI. When hibernate makes the call, it takes anywhere from 8 to 60 seconds to return one record.
I don't think this is specifically an issue with hibernate, as the query goes out, and my app just sits and waits for the data to come back. Once the information comes back, I'm off and running again.
I just figured I'd ask here because someone else might have seen the same thing.
mveitas -- the code is very simple and looks exactly like most of our other load methods:
public Content findSongByProductId(final long productId) throws DataAccessException {
return (Content) getHibernateTemplate().execute(
new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Content c = (Content)session
.createQuery(HQL_FINDSONGBYPRODUCTID)
.setLong("productId", productId)
.uniqueResult();
return c;
}
}
);
}
And the HQL looks like this: "select content from Content content join content.product product where product.id = :productId"