0 Replies Latest reply on Dec 10, 2009 10:56 AM by Wiouou

    Datamanagement and stored procedures give identity problems

    Wiouou Level 1

      Hi,

       

      I'm getting the following error when I create an item with the data services.

       

      The server returned an item without an identity.  Either the server did not set the id properties, the id properties are misconfigured or id properties toString method returned nothing.  id properties: '["sopId"]',  returned item: 'uzbrussel.service.model::StandardOperatingProcedureImpl {

       

      This results in my committed object still having the initial 0 for its id.

       

       

      Configuration settings are:

                  <metadata>
               <identity property="sopId" undefined-value="0"/>
            </metadata>

       


                     <create-item>
                          <procedure name="medocp_SOP_Insert">
                              <procedure-param property-value="#sopId#" type="OUT"/>
                              <procedure-param property-value="#serviceId#"/>
                              <procedure-param property-value="#name#"/>
                              <procedure-param property-value="#code#"/>
                              <procedure-param property-value="#workAreaId#"/>
                              <procedure-param property-value="#categoryId#"/>
                              <procedure-param property-value="#motherProcedureId#"/>
                              <procedure-param property-value="#typeId#"/>
                              <procedure-param property-value="#subTypeId#"/>
                              <procedure-param property-value="#responsableId#"/>
                              <procedure-param property-value="#revisionTime#"/>
                              <procedure-param property-value="#electronic#"/>
                              <procedure-param property-value="#modifierId#"/>
                          </procedure>
                      </create-item>

       

      The documentation says:

      As an alternative, you can setup a procedure call in the database that does the insert and id select. For the create-item element only, you can designate the procedure-param as an OUT parameter, which means that the value is returned to the client in the ActionScript instance's property-value field.

       

      But the UpdateCollectionMessage does have the right id:

       

          [1] (mx.data.messages::UpdateCollectionMessage)#21
            body = (Array)#22
              [0] (mx.data::UpdateCollectionRange)#23
                identities = (Array)#24
                  [0] (Object)#25
                    sopId = 1000016
                position = 10
                size = 1
                updateType = 0