Closed kwoot closed 6 years ago
Bugzilla Comment ID: 2175 Date: 2011-02-18 19:19:01 From: Diego Pino \<dpino@igalia.com>
The bug happens in any order when:
What it's happening is the unindented element is removed from the collection of children and assigned to a new parent. This causes the error: "Found two representations of same collection".
Apparently, the bug happens with the collection of dependencies (TaskElement.dependenciesWithThisOrigin). If the order elements are not set to be scheduled, that means, there's not Tasks associated with an OrderElement, the error doesn't happen.
The following link describes the generic reason for this error:
The problem is that that when an element from a collection is removed, hibernate marks it as deleted, but it doesn't delete it. Then when the object is added to a new collection, Hibernate thinks it's duplicated.
The entry suggest to change the cascade between parent and children from "remove" (all and all-delete-orphan, both include remove), to "save-update" and handle the deletions manually. I think this is troublesome and I'm researching for a possible alternative solution. In addition, it's not clear that changing the cascade will solve the problem.
Bugzilla Comment ID: 2176 Date: 2011-02-18 19:27:10 From: Diego Pino \<dpino@igalia.com>
BTW, to work around this bug from the functional point of view, divide this operation into two steps. First, move the nodes, save; then, delete elements, save. This way, it works.
Bugzilla Comment ID: 2206 Date: 2011-02-21 20:04:27 From: Oscar González \<ogonzalez@igalia.com>
commit 2820ba5d5f46f73225db049c861a0b51038bc01c Author: Óscar González Fernández ogonzalez@igalia.com Date: Mon Feb 21 19:31:33 2011 +0100
[Bug #861] Fix bug
Deleting the order elements without parents after the task sources
have been synchronized.
When an OrderElement is removed it's left behind whithout parent. The
method deleteOrderElementWithoutParent is responsible of deleting
them. If this is done before doing the tasks synchronization, the
associated TaskGroup to the OrderGroup removed has as children the
moved task. This causes said task to be processed twice, from two
differnet possitions: at the OrderGroup removed and at the position it
was added.
Now deleteOrderElementWithoutParent it's done after the
synchronization, so the associated TaskGroup doesn't have the moved
task.
FEA: ItEr71S04BugFixing
Bugzilla Comment ID: 2164 Date: 2011-02-18 11:13:00 From: Manuel Rego Casasnovas \<rego@igalia.com>
Steps to reproduce: 1) Go to Project Details in "Pedido Grupo 3 - FALLA" 2) Expand "Bloque 2" 3) Expand "Bloque 2 (copy)" 4) Unindent "Poñer escotillas camarote A" 5) Remove "Bloque 2 (copy)" (this will remove "Bloque 2 (copy)" and "Bloque 2 (copy) (copy)" 6) Save
The following exception arises:
Run-time error: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin; nested exception is org.hibernate.HibernateException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin . Error was registered and it will be fixed as soon as possible.
Stacktrace:
SEVERE: >>org.springframework.orm.hibernate3.HibernateSystemException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin; nested exception is org.hibernate.HibernateException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin
org.hibernate.HibernateException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin at org.hibernate.engine.Collections.processReachableCollection(Collections.java:153) at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:37) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61) at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55) ... 1531907 [29314597@qtp-11373492-10] ERROR org.navalplanner.web.error.PageForErrorOnEvent - Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin; nested exception is org.hibernate.HibernateException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin org.springframework.orm.hibernate3.HibernateSystemException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin; nested exception is org.hibernate.HibernateException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:676) at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:789) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy73.runOnTransaction(Unknown Source) at org.navalplanner.web.orders.OrderModel.save(OrderModel.java:473) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) at $Proxy131.save(Unknown Source) at org.navalplanner.web.orders.OrderCRUDController.save(OrderCRUDController.java:718) at org.navalplanner.web.orders.OrderCRUDController.saveAndContinue(OrderCRUDController.java:631) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:119) at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:310) at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:797) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:176) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:519) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:446) Caused by: org.hibernate.HibernateException: Found two representations of same collection: org.navalplanner.business.planner.entities.TaskElement.dependenciesWithThisOrigin at org.hibernate.engine.Collections.processReachableCollection(Collections.java:153) at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:37) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61) at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:138) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655) ... 36 more
Attached file: dump_curso1_navalplan_gandi_20110218.sql.gz File description: Dump NavalPlan curso1 gandi
(Original Bugzilla Bug ID: 861)
Date: 2011-02-18 11:13:00 From: Manuel Rego Casasnovas \<rego@igalia.com> To: Diego Pino \<dpino@igalia.com> Version: navalplan-1.0 (1.0.x) Last updated: 2011-02-21 20:04:27
(Note: this issue was migrated automatically with bugzilla2github.py tool )