Hi All,
We are using hibernate criteria. Its executing fine. But when I set fristResult and maxresult its throwing the below exception
StaleConnectionException: Attempt to use New Function Before New Function Mode.
The below is the code:
Criteria criteria = sessionFactory.openSession().createCriteria(DtoEqtymapNewSalPlanGrades.class); criteria.add(Restrictions.isNull(QueryConstants.ID_PPR)); criteria.addOrder(Order.asc(QueryConstants.ID_COUNTRY_CODE).ignoreCase()); criteria.setFirstResult(1); criteria.setMaxResults(12); criteria.list();
Error is throwing when we invoke criteria.list(). Its working fine, if we comment the setfirstresult and setmaxresults methods. This is in DB2 .
Because of this exception we are not able to proceed with our pagination approach. Please let me know the root cause for this.
|