Below is my code
@SuppressWarnings("unchecked")
protected List<String> executeTestQuery(final String query)
{
List<String> ret;
Session session = factory.openSession();
try
{
ret = session.createQuery(query).list();//HANGS
}
finally
{
session.flush();
session.close();
}
return ret;
}
Above method is common method which is getting called from every method and also recursively in some cases.
Hibernate hangs at mentioned point after few run.
I even added
config.setProperty(Environment.C3P0_MAX_SIZE, "100");
session.clear(), SessionFactoryUtils.releaseSession(session, factory);
Still no use.
Any suggestion for above problem would be a great help.
Thanx guys for your help.Finally problem got resolved. Problem was not with the mentioned function . Problem was with the calling function and it’s session was never getting closed .session.flush and session.close solved the problem.