Many returned records cause stackoverflow with Hibernate
Posted
by mimi law
on Stack Overflow
See other posts from Stack Overflow
or by mimi law
Published on 2008-12-12T08:57:53Z
Indexed on
2010/05/19
19:20 UTC
Read the original article
Hit count: 266
If there are many return records from DB. It will get stackoverflow problem.
User
is a class, which has a one to many relationship (to 3 other classes). When I print out the SQL, i found that the system runs the same query many time to get the data from DB. Does anyone know what the problem is?
result.addAll(getCurrentSession().createCriteria(User.class)
.add(Restrictions.ilike("name", "tom", MatchMode.ANYWHERE))
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)
.list());
© Stack Overflow or respective owner