-2

We are getting hibernate error during 2nd line:

final Session session = sessionFactory.openSession();

final List list = session.createQuery(hql).list();

and error is :

    2018-06-25 21:30:36,121  INFO  org.hibernate.event.def.DefaultLoadEventListener - Error performing load command
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bt.capman.persist.user.UserInfo#52593]
    at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
    at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
    at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:830)
    at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
    at org.hibernate.type.EntityType.resolve(EntityType.java:303)
    at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
    at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
    at org.hibernate.loader.Loader.doQuery(Loader.java:717)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
    at org.hibernate.loader.Loader.doList(Loader.java:2145)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
    at org.hibernate.loader.Loader.list(Loader.java:2024)
    at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:887)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)

Please suggest the solution. we are using XML based Hibernate.

Joachim Rohde
  • 5,915
  • 2
  • 29
  • 46
Nitin
  • 71
  • 11
  • Possible duplicate of [org.hibernate.ObjectNotFoundException: No row with the given identifier exists, but it DOES](https://stackoverflow.com/questions/8984837/org-hibernate-objectnotfoundexception-no-row-with-the-given-identifier-exists) – achAmháin Jun 26 '18 at 09:04
  • @notyou Please see error log is different and above link is getting the issue when user istrying to saveorupdate but I am doing session.createQuery(hql).list(); – Nitin Jun 26 '18 at 09:18
  • Old post mentioned the solution for annotation based and we want the xml based solution. – Nitin Jun 26 '18 at 09:19

1 Answers1

0

I got solution of above question that logs telling me that UserInfo is not available in table with user_id = 52593.

Nitin
  • 71
  • 11