Not able to retrieve saved objects from GemFire backed session

我是研究僧i 提交于 2019-12-11 15:55:27

问题


I was using the GemFire session store to save and retrieve objects.

session.getAttribute(sessionKey) and session.setAttribute(sessionKey, value)

But, sometimes after saving, when I am trying to retrieve the object on the next button click, I am getting a null value back. Other times it retrieves the value correctly. The session id used for saving and retrieving are same, but still null is retrieved.

Is there any way I could see the data that is saved in Geode's Pulse Monitoring application (Data Browser tool) for a particular key?

Any help is appreciated.


回答1:


Short answer, yes, you can either use Gfsh or Pulse's DataBrowser Tool (extension) to write OQL queries, inspecting the session objects state stored in the corresponding Region.

I have written several OQL queries (available here) allowing you to inspect an object stored in a Region, include a session object, containing session attributes, where the attribute values might refer to your application domain objects stored in the session by your application in a Spring Web MVC Controller, for instance.

These OQL queries assume you are using Spring Session for Pivotal GemFire to manage your HTTP session state (i.e. the HttpSession) along with using Pivotal GemFire as the data store provider for Spring Session.

If you are using Pivotal GemFire's HTTP Session Management Module instead, you will need to adjust these OQL queries.

Finally, be aware that you may possibly need to put your application domain object types (classes) on the servers classpath, since certain OQL query statement can cause your stored application domain object types to get deserialized.

Also, review Pivotal GemFires documentation on querying for more details.

Hope this helps!



来源:https://stackoverflow.com/questions/52409284/not-able-to-retrieve-saved-objects-from-gemfire-backed-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!