I’m trying to batch update my code field on categoryOptions through patching the individual UiD’s on /api/categoryOptions/xxhDxyT8kCD.json?preheatCache=false .
My raw json payload only includes the UiD, name and (new) code field. The server log gives a preheat and reports success on update. Comparing the before and after json the only change happened to the categoryOption is the intended one. The only issue I can see on the log side is that the preheatCache is not disabled as intended.
The server log gives the following:
INFO 2017-03-01 15:45:36,606 Building object-bridge maps (preheatCache: true, 6 classes). (DefaultObjectBridge.java [http-apr-8081-exec-9])
INFO 2017-03-01 15:45:41,828 Building object-bridge maps took 5.21 seconds. (DefaultObjectBridge.java [http-apr-8081-exec-9])
INFO 2017-03-01 15:45:42,548 ‘admin’ update org.hisp.dhis.dataelement.DataElementCategoryOption, name: AFFM1302 (Norad Education GBV and ICLA), uid: VHqcQwn3cVW (AuditLogUtil.java [http-apr-8081-exec-9])
However in Postman I can see the this error:
** HTTP Status 500 - Request processing failed; nested exception is org.hibernate.HibernateException: A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance: org.hisp.dhis.dataelement.DataElementCategoryOption.attributeValues**
···
type Exception report
message Request processing failed; nested exception is org.hibernate.HibernateException: A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance: org.hisp.dhis.dataelement.DataElementCategoryOption.attributeValues
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.HibernateException: A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance: org.hisp.dhis.dataelement.DataElementCategoryOption.attributeValues
Since I see only the intended change in the catoption json I’m considering ignoring this error and running the update. But, before I do does anyone think this could lead to any problems down the line that I don’t immediately see? The reason I am not using PUT is that I then have to re-send the sharing information (for that not to be removed in the process as it does in 2.23).
Actually the PATCH functionality (especially in earlier versions) is not the best. If you are not using attribute values, then I think you should be OK (in general only simple properties like name is supported well)
I’m trying to batch update my code field on categoryOptions through patching the individual UiD’s on /api/categoryOptions/xxhDxyT8kCD.json?preheatCache=false .
My raw json payload only includes the UiD, name and (new) code field. The server log gives a preheat and reports success on update. Comparing the before and after json the only change happened to the categoryOption is the intended one. The only issue I can see on the log side is that the preheatCache is not disabled as intended.
The server log gives the following:
INFO 2017-03-01 15:45:36,606 Building object-bridge maps (preheatCache: true, 6 classes). (DefaultObjectBridge.java [http-apr-8081-exec-9])
INFO 2017-03-01 15:45:41,828 Building object-bridge maps took 5.21 seconds. (DefaultObjectBridge.java [http-apr-8081-exec-9])
INFO 2017-03-01 15:45:42,548 ‘admin’ update org.hisp.dhis.dataelement.DataElementCategoryOption, name: AFFM1302 (Norad Education GBV and ICLA), uid: VHqcQwn3cVW (AuditLogUtil.java [http-apr-8081-exec-9])
However in Postman I can see the this error:
HTTP Status 500 - Request processing failed; nested exception is org.hibernate. HibernateException: A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance: org.hisp.dhis.dataelement.DataElementCategoryOption.attributeValues
type Exception report
message Request processing failed; nested exception is org.hibernate. HibernateException: A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance: org.hisp.dhis.dataelement.DataElementCategoryOption.attributeValues
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate. HibernateException: A collection with cascade=“all-delete-orphan” was no longer referenced by the owning entity instance: org.hisp.dhis.dataelement.DataElementCategoryOption.attributeValues
Since I see only the intended change in the catoption json I’m considering ignoring this error and running the update. But, before I do does anyone think this could lead to any problems down the line that I don’t immediately see? The reason I am not using PUT is that I then have to re-send the sharing information (for that not to be removed in the process as it does in 2.23).