Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RAM OSLC API: How can I update without changing the version?

 I can update an asset using OSLC API following the steps as mentioned in  http://open-services.net/bin/view/Main/AssetMgRestApiV1

However, if I wish to keep the version same, it give Error 500 saying something like: "Error POSTing asset Modified without version change[internal/assets/3F9330E1-1D5A-40D6-9A47-726370269C36/1.0] : The asset stest11‎[1.0] already exists. External ID is 3F9330E1-1D5A-40D6-9A47-726370269C36 and database id is 1,498."

Am I missing something?

UPDATE:

I tried sending a PUT in place of POST and get the following error:

<oslc:statusCode>
500
</oslc:statusCode>
<oslc:message>
Error PUTing asset Modified without version change[internal/assets/3F9330E1-1D5A-40D6-9A47-726370269C36/1.0] : Null pointer exception
</oslc:message>

1 vote

Comments

Is there a larger stacktrace attached to this OSLC return? You are getting an NPE on the host but we don't know where on the host it is happening?

You may need to get the host ramdebug logs at this point so we can see where the NPE is happening.



4 answers

Permanent link
Updates are done through Put. Post is only for create.

0 votes

Comments

@RichardKulp: I get a similar error when I send PUT in place of POST. Can you help?


Permanent link
Which version of OSLC are you using v1 or 2?

On a PUT, you need to make sure that the <ram_asset:revisionCount> value is proper.  This is how RAM determine if your PUT is stale or not.

... so for a test,  do a GET, and then do a PUT with the content from the GET.  If this works, than you have a good baseline to work from.  Note the on the PUT you will get the asset again, with a newer revision count.

0 votes

Comments

@GiliMendel: We are doing what you are saying. I do a GET, change the title or description without changing the version and use a PUT.

Which version or RAM / OSLC?

Try to also increment the revisioncount.


Permanent link
RAM (the web interface) allows updating an asset without changing the version. I am trying to do the same using the OSLC API for RAM version 7.5.1

0 votes


Permanent link
As Gili previously commented... "Try to also increment the revisioncount.".
The revision count is not the same as the RAM version. In order to do the PUT, you have to do the GET, then whatever the revisioncount is, try incrementing it and then do the PUT. The revisioncount is to ensure you are using the correct level of that asset and won't clobber over someone's previous changes.

0 votes

Comments

DO NOT update the revision count by hand.

The process is bring down asset xml, update what you want, and then put that back. It must have the same revision count as when it was brought down so that it can verify that the updates are based upon the current revision and not some other. If you update the revision count by hand it will no longer match what was brought down and so will not match the host and will be rejected.

After you do your update, if you want to do more, then you must bring the asset xml down again (though I think it may actually return the updated contents including the new revision count as the result of the PUT, if not then you will need to bring it down again).

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 523
× 486

Question asked: Aug 30 '12, 8:51 a.m.

Question was seen: 9,104 times

Last updated: Oct 31 '12, 8:28 a.m.

Confirmation Cancel Confirm