Project

General

Profile

bug #8075

multiple cascase all-delete-orphan exceptions related to DefinedTermBase.representations

Added by Andreas Kohlbecker 9 months ago. Updated 6 months ago.

Status:
Closed
Priority:
New
Category:
cdm-vaadin
Target version:
Start date:
03/04/2019
Due date:
% Done:

100%

Severity:
normal
Found in Version:
Tags:

Description

In the Registration UI there are a couple of
org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" ...
errors all related to eu.etaxonomy.cdm.model.common.DefinedTermBase.representations:

The according tickets groupes by the commonalities:

FilterablePagingProvider

TaxonNameStringFilterablePagingProvider

All these problems related to the TaxonNameStringFilterablePagingProvider` have most probably been fixed by the changes made in the context of #7559

#7945 "TaxonNamePopupEditor: missing genus causes exception when updating name parts visibility":

org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
               at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
...               at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
               at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1251)
...
               at com.sun.proxy.$Proxy611.findTaxonNameParts(Unknown Source)
               at eu.etaxonomy.cdm.service.TaxonNameStringFilterablePagingProvider.size(TaxonNameStringFilterablePagingProvider.java:196)
...               at eu.etaxonomy.vaadin.component.WeaklyRelatedEntityCombobox.setValue(WeaklyRelatedEntityCombobox.java:199)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNameEditorPresenter.onFieldReplaceEvent(TaxonNameEditorPresenter.java:379)
...
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.replaceComponent(AbstractPopupEditor.java:928)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.updateFieldVisibility(TaxonNamePopupEditor.java:730)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.updateAuthorshipFields(TaxonNamePopupEditor.java:628)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.afterItemDataSourceSet(TaxonNamePopupEditor.java:556)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.loadInEditor(AbstractPopupEditor.java:812)

another similar case from the server log without own ticket:

Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
        at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
...
        at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
...
        at com.sun.proxy.$Proxy611.findTaxonNameParts(Unknown Source)
        at eu.etaxonomy.cdm.service.TaxonNameStringFilterablePagingProvider.size(TaxonNameStringFilterablePagingProvider.java:196)
        at org.vaadin.viritin.fields.LazyComboBox$7.size(LazyComboBox.java:261)

more like this (3 times)

3 times

[phycobank] 2018-12-07 13:50:02,664 ...
Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
        at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
        at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
...
        at eu.etaxonomy.cdm.api.service.NameServiceImpl.findTaxonNameParts(NameServiceImpl.java:375)
...
        at com.sun.proxy.$Proxy611.findTaxonNameParts(Unknown Source)
        at eu.etaxonomy.cdm.service.TaxonNameStringFilterablePagingProvider.size(TaxonNameStringFilterablePagingProvider.java:196)
...
        at org.vaadin.viritin.LazyList.contains(LazyList.java:284)
        at eu.etaxonomy.vaadin.component.WeaklyRelatedEntityCombobox.setValue(WeaklyRelatedEntityCombobox.java:199)
        at eu.etaxonomy.cdm.vaadin.view.name.TaxonNameEditorPresenter.onFieldReplaceEvent(TaxonNameEditorPresenter.java:379)

another one

Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
        at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
...
        at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
...
        at eu.etaxonomy.cdm.api.service.NameServiceImpl.findTaxonNameParts(NameServiceImpl.java:375)
...
        at com.sun.proxy.$Proxy611.findTaxonNameParts(Unknown Source)
        at eu.etaxonomy.cdm.service.TaxonNameStringFilterablePagingProvider.size(TaxonNameStringFilterablePagingProvider.java:196)
        at org.vaadin.viritin.fields.LazyComboBox$7.size(LazyComboBox.java:261)
...
        at org.vaadin.viritin.LazyList.contains(LazyList.java:284)
        at eu.etaxonomy.vaadin.component.WeaklyRelatedEntityCombobox.setValue(WeaklyRelatedEntityCombobox.java:199)

CdmFilterablePagingProvider

#7881 "reference selection combobox broken after error in ...":

org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
        at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
...
        at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
...
        at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.countByParam(VersionableDaoBase.java:388)
...
        at eu.etaxonomy.cdm.service.CdmFilterablePagingProvider.findEntities(CdmFilterablePagingProvider.java:145)
        at org.vaadin.viritin.fields.LazyComboBox$6.findEntities(LazyComboBox.java:252)
        at org.vaadin.viritin.LazyList.findEntities(LazyList.java:221)
...
        at com.vaadin.server.communication.LegacyUidlWriter.write(LegacyUidlWriter.java:82)
        at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:143)

CdmBeanItemContainerFactory

#8065 "HibernateException: corrupt session problem breaks SpecimenTypeDesignationworkingsetEditor type designation table":

Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
    at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
...
    at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
...
    at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:214)
...
    at com.sun.proxy.$Proxy556.load(Unknown Source)
    at eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory.buildTermItemContainer(CdmBeanItemContainerFactory.java:89)
    at eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationWorkingsetEditorPresenter$1.create(SpecimenTypeDesignationWorkingsetEditorPresenter.java:206)
    at eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationWorkingsetEditorPresenter$1.create(SpecimenTypeDesignationWorkingsetEditorPresenter.java:199)

4 time the same issue from the server logs

Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
        at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
...
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:86)
...
        at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:214)
...
        at com.sun.proxy.$Proxy558.load(Unknown Source)
        at eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory.buildTermItemContainer(CdmBeanItemContainerFactory.java:89)

RegistrationWorkingsetPresenter.saveRegistrationStatusChange(...)

Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.common.DefinedTermBase.representations
        at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
        at org.hibernate.engine.internal.Collections.processUnreachableCollection(Collections.java:50)
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:243)
        at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:86)
        at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
...
        at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:42)
...
        at com.sun.proxy.$Proxy694.load(Unknown Source)
        at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.saveRegistrationStatusChange(RegistrationWorkingsetPresenter.java:364)

The above collection of elated exceptions seems to identify three hotspots where DefinedTermBase.representations loaded in another session are leaked into a second session. In two of the cases the forced flush is completely unnecessary since we only need to read data from the db:

  • CdmBeanItemContainerFactory
  • TaxonNameStringFilterablePagingProvider

The other case of RegistrationWorkingsetPresenter.saveRegistrationStatusChange(...) seems to be different. ... ---> TODO implement RegistrationService.setStatus() method #8163


Subtasks

bug #8160: CdmBeanItemContainerFactory as readonly service beanClosedAndreas Kohlbecker

bug #8161: *FilterablePagingProvider classes as transactional readonly spring beansRejectedAndreas Kohlbecker


Related issues

Related to Edit - bug #7945: TaxonNamePopupEditor: missing genus causes exception when updating name parts visibility Rejected 12/10/2018
Related to Edit - bug #8065: HibernateException: corrupt session problem breaks SpecimenTypeDesignationworkingsetEditor type designation table Closed 02/05/2019
Related to Edit - bug #7881: reference selection combobox broken after error in ... Closed 10/30/2018
Related to Edit - bug #8158: cascade="all-delete-orphan" problem when .... Closed 03/01/2019
Related to Edit - bug #7559: possibly corrupted hiberante session after previous error on saving editor Closed 07/17/2018
Related to Edit - feature request #8163: RegistrationService.setStatus() method implemented New 03/05/2019

History

#1 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#2 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#3 Updated by Andreas Kohlbecker 9 months ago

  • Target version changed from Release 5.5 to Release 5.6

#4 Updated by Andreas Kohlbecker 9 months ago

  • Related to bug #7945: TaxonNamePopupEditor: missing genus causes exception when updating name parts visibility added

#5 Updated by Andreas Kohlbecker 9 months ago

  • Related to bug #8065: HibernateException: corrupt session problem breaks SpecimenTypeDesignationworkingsetEditor type designation table added

#6 Updated by Andreas Kohlbecker 9 months ago

  • Related to bug #7881: reference selection combobox broken after error in ... added

#7 Updated by Andreas Kohlbecker 9 months ago

  • Related to bug #8158: cascade="all-delete-orphan" problem when .... added

#8 Updated by Andreas Kohlbecker 9 months ago

  • Priority changed from New to Highest

#9 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#10 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#11 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#12 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#13 Updated by Andreas Kohlbecker 8 months ago

  • Related to bug #7559: possibly corrupted hiberante session after previous error on saving editor added

#14 Updated by Andreas Kohlbecker 8 months ago

  • Description updated (diff)
  • Status changed from New to In Progress

#15 Updated by Andreas Kohlbecker 8 months ago

  • Found in Version set to Release 5.4

#16 Updated by Andreas Kohlbecker 8 months ago

  • Description updated (diff)

#17 Updated by Andreas Kohlbecker 8 months ago

  • Description updated (diff)

#18 Updated by Andreas Kohlbecker 8 months ago

#19 Updated by Andreas Kohlbecker 8 months ago

potentially fixed through the changes made for #8160, #7106

#20 Updated by Andreas Kohlbecker 8 months ago

  • Status changed from In Progress to Resolved

#21 Updated by Andreas Kohlbecker 6 months ago

  • Status changed from Resolved to Closed

the cascade="all-delete-orphan" problems did not occur again

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)