dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #44887
Issue with Aprrovals
Hi,
We are exploring approvals functionality in DHIS latest revision of 2.23.
We came across an issue with approving data.
We set up two approval levels (say 1 and 2) and added a workflow that
included both. We also created users at those levels giving the right
authorities for approvals. Logged in as user 1 (user at level 1), went to
"Data Approvals" in "Reports module and gave criteria to fetch data. Tables
are generated, but when we click on "Approve" an exception is thrown.
Screen shot here shows the exception.
[image: Inline image 1]
And here's the log trace for the same:
* INFO 2016-05-11 16:26:35,937 Approvals saved: 1
(DefaultDataApprovalService.java [http-bio-8080-exec-6])
* WARN 2016-05-11 16:26:35,945 SQL Error: 0, SQLState: 23505
(SqlExceptionHelper.java [http-bio-8080-exec-6])
* *ERROR 2016-05-11 16:26:35,946 ERROR: duplicate key value violates unique
constraint "dataapproval_unique_key"*
* Detail: Key (dataapprovallevelid, workflowid, periodid,
organisationunitid, attributeoptioncomboid)=(1319, 1324, 1331, 206, 15)
already exists. (SqlExceptionHelper.java [http-bio-8080-exec-6])*
** ERROR 2016-05-11 16:26:35,951 Exception happened while trying to invoke
the request URL:/api/dataApprovals (CrudControllerAdvice.java
[http-bio-8080-exec-6])*
*org.springframework.dao.DataIntegrityViolationException: could not execute
statement; SQL [n/a]; constraint [dataapproval_unique_key]; nested
exception is org.hibernate.exception.ConstraintViolationException: could
not execute statement*
at
org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
at
org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)
at
org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485)
at
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy58.approveData(Unknown Source)
at
org.hisp.dhis.webapi.controller.DataApprovalController.saveApproval(DataApprovalController.java:369)
at
org.hisp.dhis.webapi.controller.DataApprovalController$$FastClassBySpringCGLIB$$3201324d.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at
org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at
org.hisp.dhis.webapi.controller.DataApprovalController$$EnhancerBySpringCGLIB$$e206e617.saveApproval(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Is this a known issue? or are we missing something?
Any help here would be appreciated.
*Cheers*
Archana Chillala
Application Developer
Email archanac@xxxxxxxxxxxxxxxx
Telephone +91 9100960533 <+91+9100960533>
[image: ThoughtWorks]
<http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
Follow ups