javasassas-metadata

Use of OMI_IGNORE_NOTFOUND flag in OpenMetadata interface


In SAS Open Metadata reference (page 126), it says: The UpdateMetadata method enables you to update the properties of existing metadata objects. It returns an error if the metadata object to be updated does not exist, unless the OMI_IGNORE_NOTFOUND (134217728) flag is set.

Here is my problem, if I specify the flag or I don't specify the flag, I still get the same error: ("SASLibrary : A5X8AHW1.B40000SQ cannot be found in the wlibrary container in the Foundation repository.")

Here is a snippet that reproduces the error:

import com.sas.meta.SASOMI.IOMI;
import com.sas.metadata.MetadataUtil;
import org.omg.CORBA.StringHolder;

IOMI iOMI = ... // an instance of IOMI connection

StringHolder outputMeta = new StringHolder();

String request = ""
        + "<UpdateMetadata>"
        + "   <Metadata>"
        + "     <SASLibrary Id=\"A5X8AHW1.B40000SQ\"/>"
        + "   </Metadata>"
        + "   <NS>SAS</NS>"
        + "   <Flags>" + (MetadataUtil.OMI_IGNORE_NOTFOUND | MetadataUtil.OMI_TRUSTED_CLIENT | MetadataUtil.OMI_RETURN_LIST) + "</Flags>"
        + "   <Options/>"
        + "</UpdateMetadata>"
        ;

iOMI.DoRequest(request, outputMeta);

Any ideas what is going wrong?


Solution

  • Contrary to what that document states, I have only seen OMI_IGNORE_NOTFOUND flag work with the DeleteMetadata method.

    The javadoc also seems to support this by stating

    OMI_IGNORE_NOTFOUND (134217728) This flag is for DeleteMetadata to tell it to ignore objects not found so that it will not return on error.

    com.sas.metadata.remote.MdOMIUtil Interface Field Summery