java - Hibernate Criteria query with ge operator is getting stuck forever -
i having issue hibernate criteria "ge" operator in query. criteria code below.can please on guiding root cause of abnormal behavior of criteria.also mention table has 5 records.
levelpriority levelpriorirty = (levelpriority) crit.uniqueresult(); list<levelpriority> reslist = new arraylist<>(); criteria newcrit = getsess().createcriteria(levelpriority.class); if (levelpriorirty != null) { newcrit.add(restrictions.ge("levelpriority", levelpriorirty.getlevelpriority())); reslist = (list<levelpriority>) newcrit.list();
finally able solve it. found opening new session each time criteria being created. changed below later one.
sessionfactory.opensession();
changed
sessionfactory.getcurrentsession();
Comments
Post a Comment