Project

General

Profile

bug #8075

Updated by Andreas Kohlbecker about 1 year ago

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() RegistratinService.setStatus() method #8163

#....

Back

Add picture from clipboard (Maximum size: 40 MB)