Hibernate version: 2.1
Code between sessionFactory.openSession() and session.close():
Code:
List records = session.find(
"from BalanceVO as balance"
+ " where balance.period.start <= ? and balance.period.end > ?"
+ " and balance.userId = ?",
new Object[] { date, date, userId },
new Type[] { Hibernate.DATE, Hibernate.DATE, Hibernate.STRING }
);
//HibernateUtil.closeSession();
return (BalanceVO) records.iterator().next();
Name and version of the database you are using:
MySQL 5.0
Question:
Hi guys!
I really need your help on this one.
I'm having problems with the performance for certain finders. In this case, the table for BalanceVO contains 2375 records and it grows by at least half every month. Can anybody please tell me how I can optimize this kind of scenario?
Thanks and best regards.