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

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -