It's all about the answers!

Ask a question

Changes to RAM Asset are not visible in RAMSession object - Java API


Pramod Chavan (191620) | asked Feb 05 '14, 1:32 a.m.
 Hi,

When an asset is updated(like asset name changed, categories added/modified, etc) the changes are not visible in RAMSession object. 

Let me list down the steps that leads to this issue,
1. Create new RAM session (RAMSession object) using java API.
2. Search for assets. Let us consider the search results has returned an asset having name: Asset A.
3. Using RAM web console, change the  name of above asset to Asset B.
4. Using the same RAMSession object from Step 1, I do RAM search.
5. In the search results, I see the asset name still as Asset A. Even though in RAM search page I see the changes are visible.

Changes in category schema are also not visible.

Is this a known issue/defect with the RAM java API?

RAM ver is 7511.

Regards,
Pramod

Accepted answer


permanent link
Lin Lu (3063) | answered Feb 24 '14, 1:51 a.m.
JAZZ DEVELOPER
Hi Pramod,

RAM API caches the assets and category schemas that it used to have, so once it get a asset information from server, It first try to fetch asset from local cache. I think it does the same thing to category schema.

So I think in order to get the updated asset and category schema, one needs to call RAMSession.clear() to clear cached content before the second search operation.

Thanks.
Pramod Chavan selected this answer as the correct answer

Comments
Pramod Chavan commented Feb 24 '14, 3:37 a.m.

Hi Lin,


So, by doing RAMSession.clear(), any new changes happened to asset(like asset attribute value changed, new category added, etc) will be visible through the same session object in consecutive search? 

Also, please confirm whether new assets submitted also will be avialable using same instance.

What's the diff between clear() and clear(boolean includeMetaModel)?

Regards.


Lin Lu commented Feb 24 '14, 8:04 p.m.
JAZZ DEVELOPER

For Q1, yes.
For Q2, one need to use asset = RAMSession.getAsset(); to retrive new updated asset.
FOr Q3, I think clear()  works as clear(false). It remove only the cached assets. If one uses clear(true),  cached objects like categoryschema, community etc will also be cleared.


Pramod Chavan commented Feb 25 '14, 2:21 a.m.

 Thanks Lin.

Your answer


Register or 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.