Changes to RAM Asset are not visible in RAMSession object - Java API
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
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.
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.
Comments
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.
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.
Thanks Lin.