dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #43151
Re: Error while removing a DataElement from a ProgramStage (2.20)
Sorry guys, I really don't want to bore you, but this is becoming pretty
urgent :)... We have a program with more than 1600 DElements that is
causing an exception in the analytics engine (we can not update the
analytic tables at all in the server), and we need to remove some DElements
from that program before the next week (PSI is leading a training on next
Tuesday using the server). Would you be able to try to solve this problem?
We just need to know if it is possible (otherwise I have to look for other
potentital solutions asap).
Many thanks!
Jose
On Mon, Feb 8, 2016 at 9:06 PM, Jose Garcia Muñoz <josemp10@xxxxxxxxx>
wrote:
>
> Hi devs,
>
> We get an exception each time we want to remove a particular data element
> from its program (programstage). It seems that does not matter if the
> datalement has a trackedentityvalue or not (and it shouldn't matter
> right?). We are running 2.20 (revision 19968). It works fine for 2.22, but
> it is important for us to have this problem solved for 2.20 (if possible),
> as many dataelements do not make sense for us anymore (even we can not run
> the analytics because of this ...)
>
> Is there anything you can do from your side?
>
> Thanks guys!
> Jose
>
> Here is the error trace...
>
> * ERROR 2016-02-08 20:38:26,194 Error while executing action
> (ExceptionIntercept
> or.java [http-apr-8080-exec-6])
> org.springframework.dao.InvalidDataAccessApiUsageException: deleted object
> would
> be re-saved by cascade (remove deleted object from associations):
> [org.hisp.dhi
> s.program.ProgramStageDataElement#21547]; nested exception is
> org.hibernate.Obje
> ctDeletedException: deleted object would be re-saved by cascade (remove
> deleted
> object from associations):
> [org.hisp.dhis.program.ProgramStageDataElement#21547]
>
> at
> org.springframework.orm.hibernate4.SessionFactoryUtils.convertHiberna
> teAccessException(SessionFactoryUtils.java:193)
> at
> org.springframework.orm.hibernate4.HibernateTransactionManager.conver
> tHibernateAccessException(HibernateTransactionManager.java:730)
> at
> org.springframework.orm.hibernate4.HibernateTransactionManager.doComm
> it(HibernateTransactionManager.java:592)
> at
> org.springframework.transaction.support.AbstractPlatformTransactionMa
> nager.processCommit(AbstractPlatformTransactionManager.java:757)
> at
> org.springframework.transaction.support.AbstractPlatformTransactionMa
> nager.commit(AbstractPlatformTransactionManager.java:726)
> at
> org.springframework.transaction.interceptor.TransactionAspectSupport.
> commitTransactionAfterReturning(TransactionAspectSupport.java:521)
> at
> org.springframework.transaction.interceptor.TransactionAspectSupport.
> invokeWithinTransaction(TransactionAspectSupport.java:291)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.in
> voke(TransactionInterceptor.java:96)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:179)
> at
> org.springframework.aop.framework.adapter.MethodBeforeAdviceIntercept
> or.invoke(MethodBeforeAdviceInterceptor.java:52)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:179)
> at
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invok
> e(ExposeInvocationInterceptor.java:92)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:179)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
> cAopProxy.java:207)
> at com.sun.proxy.$Proxy91.deleteProgramStageDataElement(Unknown
> Source)
> at
> org.hisp.dhis.trackedentity.action.programstage.UpdateProgramStageAct
> ion.execute(UpdateProgramStageAction.java:474)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultA
> ctionInvocation.java:450)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(Defa
> ultActionInvocation.java:289)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:252)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalUserInterceptor.interc
> ept(XWorkPortalUserInterceptor.java:91)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalModuleInterceptor.inte
> rcept(XWorkPortalModuleInterceptor.java:92)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalMenuInterceptor.interc
> ept(XWorkPortalMenuInterceptor.java:100)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.webportal.interceptor.XWorkPortalParamsInterceptor.inte
> rcept(XWorkPortalParamsInterceptor.java:150)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.interceptor.ContextInterceptor.intercept(ContextInterce
> ptor.java:83)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.interceptor.UserSettingInterceptor.intercept(UserSettin
> gInterceptor.java:84)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.security.intercept.LoginInterceptor.intercept(LoginInte
> rceptor.java:85)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.security.intercept.XWorkSecurityInterceptor.intercept(X
> WorkSecurityInterceptor.java:116)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.interceptor.SystemSettingInterceptor.intercept(SystemSe
> ttingInterceptor.java:138)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.interceptor.I18nInterceptor.intercept(I18nInterceptor.j
> ava:139)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept
> (ParametersInterceptor.java:254)
> at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> (MethodFilterInterceptor.java:98)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.inter
> cept(StaticParametersInterceptor.java:191)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.hisp.dhis.interceptor.ExceptionInterceptor.intercept(ExceptionInt
> erceptor.java:113)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> nvocation.java:246)
> at
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.j
> ava:54)
> at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.jav
> a:562)
> at
> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(Exec
> uteOperations.java:77)
> at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
> .doFilter(StrutsPrepareAndExecuteFilter.java:99)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:243)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:210)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:330)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInter
> ceptor.invoke(FilterSecurityInterceptor.java:118)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInter
> ceptor.doFilter(FilterSecurityInterceptor.java:84)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.access.ExceptionTranslationFilter.do
> Filter(ExceptionTranslationFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.session.SessionManagementFilter.doFi
> lter(SessionManagementFilter.java:103)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AnonymousAuthenticati
> onFilter.doFilter(AnonymousAuthenticationFilter.java:113)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.servletapi.SecurityContextHolderAwar
> eRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter
> .doFilter(RequestCacheAwareFilter.java:45)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.www.BasicAuthenticati
> onFilter.doFilter(BasicAuthenticationFilter.java:150)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:100
> )
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AbstractAuthenticatio
> nProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.AbstractAuthenticatio
> nProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(Cus
> tomAuthenticationFilter.java:64)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.oauth2.provider.authentication.OAuth2Aut
>
> henticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:1
> 40)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.authentication.logout.LogoutFilter.d
> oFilter(LogoutFilter.java:110)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(Automati
> cAccessFilter.java:115)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.header.HeaderWriterFilter.doFilterIn
> ternal(HeaderWriterFilter.java:57)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
> equestFilter.java:107)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.context.request.async.WebAsyncManage
>
> rIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
> equestFilter.java:107)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.context.SecurityContextPersistenceFi
> lter.doFilter(SecurityContextPersistenceFilter.java:87)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
> doFilter(FilterChainProxy.java:342)
> at
> org.springframework.security.web.FilterChainProxy.doFilterInternal(Fi
> lterChainProxy.java:192)
> at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChai
> nProxy.java:160)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(D
> elegatingFilterProxy.java:344)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(Delegat
> ingFilterProxy.java:261)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:243)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:210)
> at
> org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.do
> FilterInternal(OpenSessionInViewFilter.java:151)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
> equestFilter.java:107)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:243)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:210)
> at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern
> al(CharacterEncodingFilter.java:85)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
> equestFilter.java:107)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:243)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:210)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> alve.java:222)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> alve.java:123)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
> torBase.java:502)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> ava:171)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> ava:100)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
> 953)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> ve.java:118)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
> a:409)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
> 11Processor.java:1044)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
> AbstractProtocol.java:607)
> at
> org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpo
> int.java:2441)
> at
> org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
> t.java:2430)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
> java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:615)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: org.hibernate.ObjectDeletedException: deleted object would be
> re-save
> d by cascade (remove deleted object from associations):
> [org.hisp.dhis.program.P
> rogramStageDataElement#21547]
> at
> org.hibernate.internal.SessionImpl.forceFlush(SessionImpl.java:1208)
> at
> org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityI
> sTransient(DefaultSaveOrUpdateEventListener.java:184)
> at
> org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.perform
> SaveOrUpdate(DefaultSaveOrUpdateEventListener.java:114)
> at
> org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveO
> rUpdate(DefaultSaveOrUpdateEventListener.java:90)
> at
> org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:
> 654)
> at
> org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:646)
>
> at
> org.hibernate.engine.spi.CascadingAction$5.cascade(CascadingAction.ja
> va:258)
> at
> org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:396)
> at
> org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java
> :339)
> at
> org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:20
> 7)
> at
> org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Casca
> de.java:426)
> at
> org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:
> 366)
> at
> org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java
> :342)
> at
> org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:20
> 7)
> at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:164)
> at
> org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnF
> lush(AbstractFlushingEventListener.java:165)
> at
> org.hibernate.event.internal.AbstractFlushingEventListener.prepareEnt
> ityFlushes(AbstractFlushingEventListener.java:156)
> at
> org.hibernate.event.internal.AbstractFlushingEventListener.flushEvery
> thingToExecutions(AbstractFlushingEventListener.java:89)
> at
> org.hibernate.event.internal.DefaultFlushEventListener.onFlush(Defaul
> tFlushEventListener.java:55)
> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)
> at
> org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404)
>
> at
> org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.before
> TransactionCommit(JdbcTransaction.java:101)
> at
> org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(A
> bstractTransactionImpl.java:175)
> at
> org.springframework.orm.hibernate4.HibernateTransactionManager.doComm
> it(HibernateTransactionManager.java:584)
> ... 120 more
>
>
References