org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102]

Hibernate JIRA | Justin Haddad | 1 decade ago
  1. 0

    This problem seems identical to issue NH-678. I have enabled caching for an one-to-many association. I use Ehcache. I have a test in which I load the parent object along with its collection. Both the parent and the collection wind up in the 2nd level cache. I then delete an object that is in the collection, not by removing it from the collection, but rather by doing a delete on the object itself. After deleting, I try to reload the parent and get the following exception (User#3102 is the deleted object): aused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102] at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:372) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:178) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:839) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177) at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:101) at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705) (continues on) I stepped through the code in the debugger and can see that the object's ID (3102 in this case) remains in the cached collection even after the deletion.

    Hibernate JIRA | 1 decade ago | Justin Haddad
    org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102]
  2. 0

    This problem seems identical to issue NH-678. I have enabled caching for an one-to-many association. I use Ehcache. I have a test in which I load the parent object along with its collection. Both the parent and the collection wind up in the 2nd level cache. I then delete an object that is in the collection, not by removing it from the collection, but rather by doing a delete on the object itself. After deleting, I try to reload the parent and get the following exception (User#3102 is the deleted object): aused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102] at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:372) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:178) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:839) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177) at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:101) at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705) (continues on) I stepped through the code in the debugger and can see that the object's ID (3102 in this case) remains in the cached collection even after the deletion.

    Hibernate JIRA | 1 decade ago | Justin Haddad
    org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102]
  3. 0

    Removing elements from all the cached, eager-loaded collections leaves ghosts

    Stack Overflow | 10 months ago | Olivier Grégoire
    org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [be.fgov.just.cjr.model.PunishmentCodeExclusion#170]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Failover exception when removing page from dashboard

    https://bugzilla.redhat.com/bugzilla/ | 7 years ago | mposolda
    org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.jboss.portal.core.impl.model.portal.ObjectNode#234]
  6. 0

    Failover exception when removing portlet from dashboard

    https://bugzilla.redhat.com/bugzilla/ | 7 years ago | mposolda
    org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.jboss.portal.core.impl.model.portal.ObjectNode#113]

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.ObjectNotFoundException

      No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102]

      at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound()
    2. Hibernate
      SessionImpl.internalLoad
      1. org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:372)
      2. org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
      3. org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:178)
      4. org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86)
      5. org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871)
      6. org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:839)
      6 frames
    3. Hibernate
      ManyToOneType.assemble
      1. org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
      2. org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177)
      2 frames
    4. Hibernate
      SessionImpl.initializeCollection
      1. org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:101)
      2. org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35)
      3. org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130)
      4. org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48)
      5. org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705)
      5 frames