org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]

Hibernate JIRA | Sapan Bharucha | 5 years ago
  1. 0

    Get method in hibernate returns null if no row is found for given ID. My understanding is that ObjectNotFoundException is thrown by hibernate while proxy returned by load is accessed and there is no row found for given ID. But i am getting this exception while using get(). Please let me know if any one you have faced this issue. org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:663) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506) ..................................... Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3] at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:447) at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:320) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:277) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990) at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) ... 185 more In my product we are using hibernate-core 3.5.1 and Spring 3.0.2.jar . We are calling get method of Spring hibernate template . We are calling hibernates session.get() method by using org.springframework.orm.hibernate3.HibernateTemplate.get(Class<Object>, Serializable) public Object findObject(Class class, Serializable id) throws HibernateException { return (Object) getHibernateTemplate().get(class, id); }

    Hibernate JIRA | 5 years ago | Sapan Bharucha
    org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]
  2. 0

    Get method in hibernate returns null if no row is found for given ID. My understanding is that ObjectNotFoundException is thrown by hibernate while proxy returned by load is accessed and there is no row found for given ID. But i am getting this exception while using get(). Please let me know if any one you have faced this issue. org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:663) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506) ..................................... Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3] at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:447) at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:320) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:277) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990) at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) ... 185 more In my product we are using hibernate-core 3.5.1 and Spring 3.0.2.jar . We are calling get method of Spring hibernate template . We are calling hibernates session.get() method by using org.springframework.orm.hibernate3.HibernateTemplate.get(Class<Object>, Serializable) public Object findObject(Class class, Serializable id) throws HibernateException { return (Object) getHibernateTemplate().get(class, id); }

    Hibernate JIRA | 5 years ago | Sapan Bharucha
    org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]
  3. 0

    hibernate template find() HibernateObjectRetrievalFailureException

    Stack Overflow | 3 years ago | user1187719
    org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [gov.usdoj.afms.umc.hibernate.model.OrgLvl2L#gov.usdoj.afms.umc.hibernate.model.OrgLvl2LId@3d4ed6f3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [gov.usdoj.afms.umc.hibernate.model.OrgLvl2L#gov.usdoj.afms.umc.hibernate.model.OrgLvl2LId@3d4ed6f3]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. musketyr 2 times, last 4 weeks ago

Root Cause Analysis

  1. org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException

    No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.data.PersonDO#com.data.PersonId@348515a3]

    at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException()
  2. Hibernate
    HibernateTemplate.get
    1. org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:663)
    2. org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
    3. org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
    4. org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    5. org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512)
    6. org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506)
    6 frames