← Back to team overview

dhis2-devs team mailing list archive

Sharing in meta data uploads

 

Hello Devs

Version:2.21Build revision:21027

I've tried using the "sharing=true" via a cURL command and it is spitting
out an HTTP 500 error:

HTTP Status 500 - Request processing failed; nested exception is
org.hibernate.TransientObjectException: object references an unsaved
transient instance - save the transient instance before flushing:
org.hisp.dhis.user.UserGroupAccess

Here is the cURL command sans pwd

curl -X POST -H "Content-Type: application/xml" -u admin:district -d
@NewDataElements.xml "
http://localhost:8080/dhis/api/metaData?preheatCache=false&dryRun=false&sharing=true";
-v

Here is a snippit of the XML file:

        <dataElement name="Test" shortName="Test" code="Test"
id="a1234567890">
            <description>Test Description</description>
            <domainType>AGGREGATE</domainType>
            <zeroIsSignificant>true</zeroIsSignificant>
            <categoryCombo name="Test" id="b1234567890"/>
            <valueType>INTEGER</valueType>
            <userGroupAccesses>
                <userGroupAccess>
                    <access>r-------</access>
                    <userGroupUid>c1234567890</userGroupUid>
                    <displayName>Test Group</displayName>
                    <id>c1234567890</id>
                </userGroupAccess>
            </userGroupAccesses>
            <publicAccess>--------</publicAccess>
            <aggregationType>SUM</aggregationType>
        </dataElement>

It works just fine when I set sharing=false. Any ideas?


*Timothy Harding*
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007

PNG image


Follow ups