org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.wuerth.phoenix.Cis.bc.persistent.jpa.BusinessCardPeer#711]

Hibernate JIRA | Guenther Demetz | 2 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Until Hibernate4.2 StaleObjectStateExceptions were raised exclusively on flush calls. Now with Hibernate4.3.9 we have StaleObjectStateExceptions too on read calls (CollectionInitialize), which seems unexpected behavior since Hibernate should maintain his repeatable-read behavior. Here a stacktrace: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.wuerth.phoenix.Cis.bc.persistent.jpa.BusinessCardPeer#711] at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion(EntityReferenceInitializerImpl.java:499) at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion(EntityReferenceInitializerImpl.java:453) at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.hydrateEntityState(EntityReferenceInitializerImpl.java:209) at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.readRow(AbstractRowReader.java:107) at org.hibernate.loader.plan.exec.process.internal.ResultSetProcessorImpl.extractResults(ResultSetProcessorImpl.java:129) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:138) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102) at org.hibernate.loader.collection.plan.AbstractLoadPlanBasedCollectionInitializer.initialize(AbstractLoadPlanBasedCollectionInitializer.java:100) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:693) at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:92) at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1933) at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:558) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:260) at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:554) at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:142) at org.hibernate.collection.internal.PersistentSet.toArray(PersistentSet.java:187) at java.util.Collections$UnmodifiableCollection.toArray(Collections.java:1033) at java.util.ArrayList.<init>(ArrayList.java:177) at com.wuerth.phoenix.cis.tasks.tools.monitors.creditlimitmonitor.CreditLimitMonitorTableModel.getValueAt(CreditLimitMonitorTableModel.java:226) As you can see from the stack we are clearly outside any flush context here, how is that possible? Until now I was not able to reproduce it in a testcase...sorry.

    Hibernate JIRA | 2 years ago | Guenther Demetz
    org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.wuerth.phoenix.Cis.bc.persistent.jpa.BusinessCardPeer#711]
  2. 0

    Until Hibernate4.2 StaleObjectStateExceptions were raised exclusively on flush calls. Now with Hibernate4.3.9 we have StaleObjectStateExceptions too on read calls (CollectionInitialize), which seems unexpected behavior since Hibernate should maintain his repeatable-read behavior. Here a stacktrace: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.wuerth.phoenix.Cis.bc.persistent.jpa.BusinessCardPeer#711] at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion(EntityReferenceInitializerImpl.java:499) at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion(EntityReferenceInitializerImpl.java:453) at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.hydrateEntityState(EntityReferenceInitializerImpl.java:209) at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.readRow(AbstractRowReader.java:107) at org.hibernate.loader.plan.exec.process.internal.ResultSetProcessorImpl.extractResults(ResultSetProcessorImpl.java:129) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:138) at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102) at org.hibernate.loader.collection.plan.AbstractLoadPlanBasedCollectionInitializer.initialize(AbstractLoadPlanBasedCollectionInitializer.java:100) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:693) at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:92) at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1933) at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:558) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:260) at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:554) at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:142) at org.hibernate.collection.internal.PersistentSet.toArray(PersistentSet.java:187) at java.util.Collections$UnmodifiableCollection.toArray(Collections.java:1033) at java.util.ArrayList.<init>(ArrayList.java:177) at com.wuerth.phoenix.cis.tasks.tools.monitors.creditlimitmonitor.CreditLimitMonitorTableModel.getValueAt(CreditLimitMonitorTableModel.java:226) As you can see from the stack we are clearly outside any flush context here, how is that possible? Until now I was not able to reproduce it in a testcase...sorry.

    Hibernate JIRA | 2 years ago | Guenther Demetz
    org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.wuerth.phoenix.Cis.bc.persistent.jpa.BusinessCardPeer#711]
  3. 0

    [HHH-9764] StaleObjectStateExceptions raising outside flush context. - Hibernate JIRA

    atlassian.net | 1 year ago
    org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) :
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate StaleObjectStateException when reading

    Stack Overflow | 2 years ago | DD.
    org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.example.model.Order#95813]

    Root Cause Analysis

    1. org.hibernate.StaleObjectStateException

      Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.wuerth.phoenix.Cis.bc.persistent.jpa.BusinessCardPeer#711]

      at org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion()
    2. org.hibernate.loader
      AbstractLoadPlanBasedCollectionInitializer.initialize
      1. org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion(EntityReferenceInitializerImpl.java:499)
      2. org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.checkVersion(EntityReferenceInitializerImpl.java:453)
      3. org.hibernate.loader.plan.exec.process.internal.EntityReferenceInitializerImpl.hydrateEntityState(EntityReferenceInitializerImpl.java:209)
      4. org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.readRow(AbstractRowReader.java:107)
      5. org.hibernate.loader.plan.exec.process.internal.ResultSetProcessorImpl.extractResults(ResultSetProcessorImpl.java:129)
      6. org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:138)
      7. org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102)
      8. org.hibernate.loader.collection.plan.AbstractLoadPlanBasedCollectionInitializer.initialize(AbstractLoadPlanBasedCollectionInitializer.java:100)
      8 frames
    3. Hibernate
      PersistentSet.toArray
      1. org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:693)
      2. org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:92)
      3. org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1933)
      4. org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:558)
      5. org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:260)
      6. org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:554)
      7. org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:142)
      8. org.hibernate.collection.internal.PersistentSet.toArray(PersistentSet.java:187)
      8 frames
    4. Java RT
      ArrayList.<init>
      1. java.util.Collections$UnmodifiableCollection.toArray(Collections.java:1033)
      2. java.util.ArrayList.<init>(ArrayList.java:177)
      2 frames
    5. com.wuerth.phoenix
      CreditLimitMonitorTableModel.getValueAt
      1. com.wuerth.phoenix.cis.tasks.tools.monitors.creditlimitmonitor.CreditLimitMonitorTableModel.getValueAt(CreditLimitMonitorTableModel.java:226)
      1 frame