LibrePlan / libreplan

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

Lazy initialization with calendar in operation in gantt #1358

Closed kwoot closed 6 years ago

kwoot commented 13 years ago

(Original Bugzilla Bug ID: 1214)

Date: 2011-10-13 17:44:28 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-20 12:08:48


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

kwoot commented 6 years ago

Bugzilla Comment ID: 3223 Date: 2011-10-13 17:44:28 From: Javier Morán \<jmoran@igalia.com>

With the attached dump if you do the following steps you get the exception [1]:

[1]Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.navalplanner.business.common.AdHocTransactionService$2.execute(AdHocTransactionService.java:101) at org.navalplanner.business.common.AdHocTransactionService.runOnReadOnlyTransaction(AdHocTransactionService.java:117) at sun.reflect.GeneratedMethodAccessor77.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 $Proxy30.runOnReadOnlyTransaction(Unknown Source) at org.navalplanner.business.common.AdHocTransactionService$1.invoke(AdHocTransactionService.java:81) at $Proxy156.reloadChart(Unknown Source) at org.zkoss.ganttz.adapters.PlannerConfiguration.reloadCharts(PlannerConfiguration.java:404) at org.zkoss.ganttz.FunctionalityExposedForExtensions.reloadCharts(FunctionalityExposedForExtensions.java:467) at org.zkoss.ganttz.extensions.ContextRelativeToOtherComponent.reloadCharts(ContextRelativeToOtherComponent.java:113) at org.zkoss.ganttz.extensions.ContextWithPlannerTask.reloadCharts(ContextWithPlannerTask.java:115) at org.navalplanner.web.planner.taskedition.EditTaskController.askForReloads(EditTaskController.java:313) at org.navalplanner.web.planner.taskedition.EditTaskController.accept(EditTaskController.java:284) at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source) 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:134) ... 6 more Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.navalplanner.business.calendars.entities.CalendarData.capacityPerDay, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:151) at org.hibernate.collection.PersistentMap.get(PersistentMap.java:146) at org.navalplanner.business.calendars.entities.CalendarData.getCapacityOn(CalendarData.java:153) at org.navalplanner.business.calendars.entities.BaseCalendar.getCapacityConsideringCalendarDatasOn(BaseCalendar.java:336) at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157) at org.navalplanner.business.calendars.entities.BaseCalendar$$EnhancerByCGLIB$$f66870e5.getCapacityConsideringCalendarDatasOn() at org.navalplanner.business.calendars.entities.BaseCalendar.getCapacityConsideringCalendarDatasOn(BaseCalendar.java:339) at org.navalplanner.business.calendars.entities.BaseCalendar.findCapacityAt(BaseCalendar.java:326) at org.navalplanner.business.calendars.entities.BaseCalendar.getCapacityWithOvertime(BaseCalendar.java:315) at org.navalplanner.business.calendars.entities.BaseCalendar.getCapacityOn(BaseCalendar.java:308) at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157) at org.navalplanner.business.calendars.entities.ResourceCalendar$$EnhancerByCGLIB$$7882a62.getCapacityOn() at org.navalplanner.business.planner.chart.ResourceLoadChartData.calendarCapacityFor(ResourceLoadChartData.java:246) at org.navalplanner.business.planner.chart.ResourceLoadChartData$2$1.from(ResourceLoadChartData.java:129) at org.navalplanner.business.planner.chart.ResourceLoadChartData$2$1.from(ResourceLoadChartData.java:124) at org.navalplanner.business.workingday.EffortDuration.sum(EffortDuration.java:128) at org.navalplanner.business.planner.chart.ResourceLoadChartData$2.transform(ResourceLoadChartData.java:123) at org.navalplanner.business.planner.chart.ResourceLoadChartData$2.transform(ResourceLoadChartData.java:116) at org.navalplanner.business.planner.chart.ContiguousDaysLine$7.transform(ContiguousDaysLine.java:365) at org.navalplanner.business.planner.chart.ContiguousDaysLine.transform(ContiguousDaysLine.java:337) at org.navalplanner.web.planner.order.OrderPlanningModel$OrderLoadChartFiller.getPlotInfos(OrderPlanningModel.java:1114) at org.navalplanner.web.planner.chart.LoadChartFiller.fillChart(LoadChartFiller.java:46) at org.navalplanner.web.planner.chart.Chart.fillChart(Chart.java:49) at org.navalplanner.web.planner.order.OrderPlanningModel$8.reloadChart(OrderPlanningModel.java:890) ... 41 more

kwoot commented 6 years ago

Bugzilla Comment ID: 3224 Date: 2011-10-13 17:44:59 From: Javier Morán \<jmoran@igalia.com>


Attached file: dump_dev.sql File description: database dump

kwoot commented 6 years ago

Bugzilla Comment ID: 3249 Date: 2011-10-20 12:08:48 From: Manuel Rego Casasnovas \<rego@igalia.com>

commit b87ea09c0f3c11fad6550424ac7c1271eb5b2f93 Author: Manuel Rego Casasnovas rego@igalia.com Date: Thu Oct 20 13:55:21 2011 +0200

[Bug #1214] Fix issue changing Hibernate mapping for map inside CalendarData

Now capacityPerDay map is not lazy and it's loaded with the
CalendarData. This fixes the problem when the load chart was printed.

FEA: ItEr75S04BugFixing