LibrePlan / libreplan

LibrePlan - Open Web Planning
https://www.libreplan.dev
GNU Affero General Public License v3.0
287 stars 170 forks source link

NonUniqueObjectException in gantt planning #1361

Closed kwoot closed 6 years ago

kwoot commented 13 years ago

(Original Bugzilla Bug ID: 1217)

Date: 2011-10-14 14:11:32 From: Javier Morán \<jmoran@igalia.com> To: Manuel Rego Casasnovas \<rego@igalia.com> Version: libreplan-1.2 (1.2.x) Last updated: 2011-10-19 10:41:18


(Note: this issue was migrated automatically with bugzilla2github.py tool )

kwoot commented 6 years ago

Bugzilla Comment ID: 3228 Date: 2011-10-14 14:11:32 From: Javier Morán \<jmoran@igalia.com>

Do the following steps:

1.- Create a project with a task TA WBS with a criterion requirement at order level RQA 2.- Go to gantt view and open the allocation pop-up of task TA 3.- Withouth saving go back to the "project details" perspectives and add a second task TB 4.- Without saving go to project planning and open the allocation pop-up of TB

At this point you get the error:

org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [org.navalplanner.business.resources.entities.Criterion#21816]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [org.navalplanner.business.resources.entities.Criterion#21816] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:676) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.convertHibernateAccessException(AbstractSessionFactoryBean.java:303) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.translateExceptionIfPossible(AbstractSessionFactoryBean.java:282) at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:62) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:146) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy57.reattachUnmodifiedEntity(Unknown Source) at org.navalplanner.web.planner.allocation.ResourceAllocationModel.reattachCriterion(ResourceAllocationModel.java:354) at org.navalplanner.web.planner.allocation.ResourceAllocationModel.reattachCriterions(ResourceAllocationModel.java:315) at org.navalplanner.web.planner.allocation.ResourceAllocationModel.reattachHoursGroup(ResourceAllocationModel.java:310) at org.navalplanner.web.planner.allocation.ResourceAllocationModel.reattachTaskSource(ResourceAllocationModel.java:349) at org.navalplanner.web.planner.allocation.ResourceAllocationModel.initAllocationsFor(ResourceAllocationModel.java:266) at sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source) 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.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy138.initAllocationsFor(Unknown Source) at org.navalplanner.web.planner.allocation.ResourceAllocationController.init(ResourceAllocationController.java:182) at org.navalplanner.web.planner.taskedition.EditTaskController.showTabPanel(EditTaskController.java:180) at org.navalplanner.web.planner.taskedition.EditTaskController.showSelectedTabPanel(EditTaskController.java:164) at org.navalplanner.web.planner.taskedition.EditTaskController.showEditForm(EditTaskController.java:151) at org.navalplanner.web.planner.taskedition.EditTaskController.showEditFormResourceAllocation(EditTaskController.java:240) at org.navalplanner.web.planner.taskedition.EditTaskController.showEditFormResourceAllocation(EditTaskController.java:221) at org.navalplanner.web.planner.allocation.ResourceAllocationCommand.doAction(ResourceAllocationCommand.java:66) at org.navalplanner.web.planner.allocation.ResourceAllocationCommand.doAction(ResourceAllocationCommand.java:42) at org.zkoss.ganttz.CommandOnTaskContextualized.doAction(CommandOnTaskContextualized.java:72) at org.zkoss.ganttz.CommandOnTaskContextualized.doAction(CommandOnTaskContextualized.java:57) at org.zkoss.ganttz.TaskList$1.onEvent(TaskList.java:183) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:192) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:517) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:444) Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [org.navalplanner.business.resources.entities.Criterion#21816] at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:590) at org.hibernate.event.def.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:53) at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:59) at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:585) at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:577) at org.navalplanner.business.common.daos.GenericDAOHibernate.reattachUnmodifiedEntity(GenericDAOHibernate.java:114) at org.navalplanner.business.common.daos.GenericDAOHibernate.reattachUnmodifiedEntity(GenericDAOHibernate.java:61) at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) 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.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:138) ... 33 more

kwoot commented 6 years ago

Bugzilla Comment ID: 3245 Date: 2011-10-19 10:41:18 From: Manuel Rego Casasnovas \<rego@igalia.com>

commit e1f1e2f08345b418cf31101c48dfaea9ccea32b4 Author: Manuel Rego Casasnovas rego@igalia.com Date: Wed Oct 19 12:29:38 2011 +0200

[Bug #1217] Fix issue avoiding reattach of criteria

We don't need to reattach criteria in ResourceAllocationModel, as
they're already loaded in PlanningStateCreator.

FEA: ItEr75S04BugFixing
kwoot commented 6 years ago

Bugzilla Comment ID: 3244 Date: 2011-10-19 08:56:19 From: Manuel Rego Casasnovas \<rego@igalia.com>

I'm able to reproduce the same issue with different steps: 1.- Create a project with a task TA WBS with a criterion requirement at order level RQA 2.- Save 3.- Go to gantt view and open the allocation pop-up of task TA