LibrePlan / libreplan

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

Adding work report to two different people fails #220

Closed kwoot closed 6 years ago

kwoot commented 15 years ago

(Original Bugzilla Bug ID: 76)

Date: 2009-10-30 10:51:33 From: Xavi Castaño \<xcastanho@igalia.com> To: Diego Pino \<dpino@igalia.com> Version: navalplan-1.0 (1.0.x) Last updated: 2015-09-18 15:13:51


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

kwoot commented 6 years ago

Bugzilla Comment ID: 173 Date: 2009-10-30 10:51:33 From: Xavi Castaño \<xcastanho@igalia.com>

Adding new work report... to a person different from the first ones.

7352474 [1604382968@qtp-1713279871-45] ERROR org.navalplanner.web.error.PageForErrorOnEvent - Don't change the reference to a collection with cascade="all-delete-orphan": org.navalplanner.business.workreports.entities.WorkReport.workReportLines; nested exception is org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": org.navalplanner.business.workreports.entities.WorkReport.workReportLines org.springframework.orm.hibernate3.HibernateSystemException: Don't change the reference to a collection with cascade="all-delete-orphan": org.navalplanner.business.workreports.entities.WorkReport.workReportLines; nested exception is org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": org.navalplanner.business.workreports.entities.WorkReport.workReportLines 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 $Proxy87.save(Unknown Source) at org.navalplanner.web.workreports.WorkReportCRUDController.save(WorkReportCRUDController.java:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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:787) 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:493) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:425) Caused by: org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": org.navalplanner.business.workreports.entities.WorkReport.workReportLines at org.hibernate.engine.Collections.prepareCollectionForUpdate(Collections.java:226) at org.hibernate.engine.Collections.processReachableCollection(Collections.java:185) 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:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655) ... 27 more

kwoot commented 6 years ago

Bugzilla Comment ID: 192 Date: 2009-11-04 20:00:08 From: Diego Pino \<dpino@igalia.com>

Cannot reproduce bug.

However it would be convenient to change the implementation of how to add and remove WorkReportLine to a WorkReport, according to how we do in the rest of entities. The error may have to do with this, as right the collection of WorkReportLine is being manipulated direcly.

kwoot commented 6 years ago

Bugzilla Comment ID: 199 Date: 2009-11-09 18:50:00 From: Diego Pino \<dpino@igalia.com>

Well, finally following the recommendations from this article:

I decided to change the implementation of how to set WorkReportLine, and create two methods: addWorkReportLine and removeWorkReportLine to manipulate the collection.

"Since you are operating on the collection maintained and observed by Hibernate, it is able to track your changes, whereas replacing the collection wholesale makes Hibernate really mad, since it believes it is the sole proprietor of the collection, not you!"

In addition, I refactored some code in WorkReport and WorkReporLine:

kwoot commented 6 years ago

Bugzilla Comment ID: 203 Date: 2009-11-10 22:13:35 From: Javier Morán \<jmoran@igalia.com>

On removing a workreportline of a workreport the following exception occurs:

.04 (hardy) Firefox/3.0.14" 10-nov-2009 22:10:18 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1131 GRAVE: >>java.lang.NullPointerException

at org.navalplanner.web.workreports.WorkReportCRUDController.getWorkReportLineName(WorkReportCRUDController.java:589) at org.navalplanner.web.workreports.WorkReportCRUDController.confirmRemove(WorkReportCRUDController.java:576) at org.navalplanner.web.workreports.WorkReportCRUDController$4.onEvent(WorkReportCRUDController.java:568) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:197) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:493) ... 440225 [1108234599@qtp-3931207-7] ERROR org.navalplanner.web.error.PageForErrorOnEvent - Exception desconocida: java.lang.NullPointerException. java.lang.NullPointerException at org.navalplanner.web.workreports.WorkReportCRUDController.getWorkReportLineName(WorkReportCRUDController.java:589) at org.navalplanner.web.workreports.WorkReportCRUDController.confirmRemove(WorkReportCRUDController.java:576) at org.navalplanner.web.workreports.WorkReportCRUDController$4.onEvent(WorkReportCRUDController.java:568) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:197) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:493) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:425)

kwoot commented 6 years ago

Bugzilla Comment ID: 204 Date: 2009-11-10 22:16:21 From: Javier Morán \<jmoran@igalia.com>

(In reply to comment #3)

On removing a workreportline of a workreport the following exception occurs:

It happens when you delete a workreportline which is empty and still has not been saved and has not worker assciated.

If it has a worker or orderline associated another exception happens too.

kwoot commented 6 years ago

Bugzilla Comment ID: 205 Date: 2009-11-14 19:42:34 From: Javier Morán \<jmoran@igalia.com>

Solved with commit b48e7bdca4af40c5dd45873bbfcd995d1659f2a8

kwoot commented 6 years ago

Bugzilla Comment ID: 4619 Date: 2015-09-18 15:13:51 From: Misha \<Gd.misha@gmail.com>

Ops, I've mixed bugs, Sorry :)

kwoot commented 6 years ago

Bugzilla Comment ID: 4616 Date: 2015-09-18 15:04:25 From: Misha \<Gd.misha@gmail.com>

Hello, Xavi Castaño

I am working for solution of your bug. The problem is tha i can't reproduce it. I've modelled the same situation here, and it works correctly. So, I need some additional information. What server do you use, what settings on it. Supply a dump of your server with settings(encode your information). Supply also other information you think can be relevant. And I will try to solve your problem.

My emails: Gd.misha@gmail.com (prefered) or misha@libreplan-enterprise.com

kwoot commented 6 years ago

Bugzilla Comment ID: 4617 Date: 2015-09-18 15:05:27 From: Misha \<Gd.misha@gmail.com>

Hello, Xavi Castaño

I am working for solution of your bug. The problem is tha i can't reproduce it. I've modelled the same situation here, and it works correctly. So, I need some additional information. What server do you use, what settings on it. Supply a dump of your server with settings(encode your information). Supply also other information you think can be relevant. And I will try to solve your problem.

My emails: Gd.misha@gmail.com (prefered) or misha@libreplan-enterprise.com