Project

General

Profile

bug #6657

Reproducable "multiple representations" exception for polytomous keys

Added by Andreas Müller over 2 years ago. Updated almost 2 years ago.

Status:
Worksforme
Priority:
Highest
Assignee:
Category:
taxeditor
Target version:
-
Start date:
05/19/2017
Due date:
% Done:

0%

Severity:
major
Found in Version:

Description

When trying to exchange or delete the taxon link in a polytomous key you get an multiple representations exception:

What I did:

  1. Create a new key "MultiRepTest"
  2. Create a new key node (1a) for this key
  3. Attache any existing taxon to this key node
  4. Save and close key
  5. Reopen key and select key node
  6. Remove taxon from key node
  7. Save => exception

Same happens if trying to replace the taxon by another one

login : admin
editor version : 4.7.0
server : test.e-taxonomy.eu (edit-test) / rem_conf_am
schema version : 4.1.0.0.201607300000
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
java.lang.IllegalStateException: Multiple representations of the same entity [eu.etaxonomy.cdm.model.description.PolytomousKey#41] are being merged. Detached: [MultiRepTest]; Detached: [MultiRepTest]
    at org.hibernate.event.internal.EntityCopyNotAllowedObserver.entityCopyDetected(EntityCopyNotAllowedObserver.java:37)
    at org.hibernate.event.internal.MergeContext.put(MergeContext.java:245)
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:304)
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170)
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:850)
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:832)
    at org.hibernate.engine.spi.CascadingActions$6.cascade(CascadingActions.java:260)
    at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:398)
    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323)
    at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:162)
    at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:111)
    at org.hibernate.event.internal.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:468)
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:327)
    at 
...
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy674.merge(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at ...
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1519)

Related issues

Related to Edit - bug #6706: Sometimes selected taxa are not synchronized in PolytomousKey Editor New 06/08/2017
Related to Edit - bug #6971: Collect all remaining appearances of multiple representation exceptions since 4.10 New 07/14/2016

Associated revisions

Revision b3f33ee9 (diff)
Added by Katja Luther about 2 years ago

fix #6657: load polytomouskey with propertypath in key editor

History

#1 Updated by Andreas Müller over 2 years ago

  • Description updated (diff)
  • Found in Version set to Release 4.7

#2 Updated by Katja Luther about 2 years ago

This exception does not appear every time, when it appears the session debugging looks like this:

<<< Root Entity PolytomousKey with id 10 >>>
Duplicate CDM Entities,
 - key:PolytomousKey/10     in entity eu.etaxonomy.cdm.model.description.PolytomousKeyNode with id : 84
  -- entity belongs to cache(s) : 
 - :PolytomousKey/10
  -- entity belongs to cache(s) : {TC}
-----------
 - key:PolytomousKey/10     in entity eu.etaxonomy.cdm.model.description.PolytomousKeyNode with id : 10
  -- entity belongs to cache(s) : {TC}
 - key:PolytomousKey/10      in entity eu.etaxonomy.cdm.model.description.PolytomousKeyNode with id : 84
  -- entity belongs to cache(s) : 
-----------


Not In Cache Entities,
 - key:PolytomousKey/10 of entity PolytomousKeyNode

The node with Id 84 seems not to be loaded correctly and is not in the cache.

#3 Updated by Katja Luther about 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#4 Updated by Katja Luther about 2 years ago

  • Assignee changed from Katja Luther to Andreas Müller
  • % Done changed from 50 to 0

This exception does not appear every time, when it appears the session debugging looks like this:

<<< Root Entity PolytomousKey with id 10 >>>
Duplicate CDM Entities,
 - key:PolytomousKey/10     in entity eu.etaxonomy.cdm.model.description.PolytomousKeyNode with id : 84
  -- entity belongs to cache(s) : 
 - :PolytomousKey/10
  -- entity belongs to cache(s) : {TC}
-----------
 - key:PolytomousKey/10     in entity eu.etaxonomy.cdm.model.description.PolytomousKeyNode with id : 10
  -- entity belongs to cache(s) : {TC}
 - key:PolytomousKey/10      in entity eu.etaxonomy.cdm.model.description.PolytomousKeyNode with id : 84
  -- entity belongs to cache(s) : 
-----------

Not In Cache Entities,
 - key:PolytomousKey/10 of entity PolytomousKeyNode

loading the polytomouskey with propertyPath seems to solve the problem.

please review.

#5 Updated by Andreas Müller about 2 years ago

  • Description updated (diff)

#6 Updated by Andreas Müller about 2 years ago

  • Description updated (diff)
  • Status changed from Resolved to Feedback

In most cases this seems to work now. However I still have multiple strange behaviors with key "KomplexKey" on edit-test/rem_conf_am.

It was almost impossible to change any node here (either by adding a taxon or changing the modifying text). I usually get:

login : admin
editor version : 4.8.0.201706072259
server : test.e-taxonomy.eu (edit-test) / rem_conf_am
schema version : 4.7.0.0.201710040000
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
java.lang.IllegalStateException: Multiple representations of the same entity [eu.etaxonomy.cdm.model.description.PolytomousKey#12] are being merged. Detached: [Ich]; Detached: [Ich]
    at org.hibernate.event.internal.EntityCopyNotAllowedObserver.entityCopyDetected(EntityCopyNotAllowedObserver.java:37)
    at org.hibernate.event.internal.MergeContext.put(MergeContext.java:245)
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:304)
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170)
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:850)
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:832)
    at org.hibernate.engine.spi.CascadingActions$6.cascade(CascadingActions.java:260)
    at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:398)
    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323)
    at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:162)
    at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:111)
    at org.hibernate.event.internal.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:468)
    at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:327)
    at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170)
    at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:850)
    at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:832)
    at org.hibernate.engine.spi.CascadingActions$6.cascade(CascadingActions.java:260)
    at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:398)
    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:323)
    at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:162)
    at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:431)
    at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:363)
    at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:326)

Only once I was successful with Edge 2b (maybe because I did before rename the key in the same session, renaming was also successful).
Strange is that trying to remove this exact taxon again leads to the original exception while at most other places it does not.

We need to check if there is something special about this exact key which leads to the exceptions.

There is also an other issue with adding taxon nodes (#6706) which might be related.

#7 Updated by Andreas Müller about 2 years ago

  • Assignee changed from Andreas Müller to Katja Luther

#8 Updated by Andreas Müller about 2 years ago

  • Related to bug #6706: Sometimes selected taxa are not synchronized in PolytomousKey Editor added

#9 Updated by Katja Luther about 2 years ago

  • Target version changed from Release 4.8 to Release 4.10

#10 Updated by Katja Luther almost 2 years ago

  • Status changed from Feedback to Worksforme
  • Target version deleted (Release 4.10)

this "reproducable" multiple representation exception is not reproducable anymore. Close this ticket and create a new one to collect remaining exceptions in migrated editor.

#11 Updated by Katja Luther almost 2 years ago

  • Related to bug #6971: Collect all remaining appearances of multiple representation exceptions since 4.10 added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)