← Back to team overview

dhis2-users team mailing list archive

Could not delete due to association with another object: ProgramStageInstance

 

Hi,all,


  I meet this problem after I have deleted some program successfully,  got error at catalina.out:


* WARN  2018-11-18 20:06:44,416 SQL Error: 0, SQLState: 23503 (SqlExceptionHelper.java [http-nio-8050-exec-15])
* ERROR 2018-11-18 20:06:44,416 错误: 在 "programstage" 上的更新或删除操作违反了在 "mapview" 上的外键约束 "fk_mapview_programstageid"
  详细:键值对(programstageid)=(37661)仍然是从表"mapview"引用的. (SqlExceptionHelper.java [http-nio-8050-exec-15])
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:149)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164)
        at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1443)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1423)
        at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:200)




......
Caused by: org.postgresql.util.PSQLException: 错误(ERROR): 在 "programstage" 上的更新或删除操作违反了在 "mapview" 上的外键约束 "fk_mapview_programstageid" (violate the fk constraints in update or delete mapview fk in programstage..)
  详细:键值对(programstageid)=(37661)仍然是从表"mapview"引用的.
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)


---
DHIS29,  ubuntu,tomcat 8.54,jdk 1.8
--
Thanks.




此致

easy 

莫愁前路无知己,天下谁人不识君。