Checking Session Contents
Written by Joseph Ottinger
It's often useful to have a generic JSP page to show session objects, not only to see what's being stored in a session but also to allow you to estimate the effects a session might have on clustering.
To explain: Orion requires serializability for replicated attributes (see section 1.2), so nonserializable objects will not be replicated in a cluster. The size of serializable objects also factors in because a session that's 1K, when serialized, will affect the cluster much less than a session that's one megabyte in size. (Your Humble Author has seen a session that's well over thirty megabytes in size, which was obviously a performance problem - except that the developers in question were under the impression that session replication was "transparent.")
This jsp page/sessiondump will show every attribute a session contains, as well as its size when serialized (and a message indicating its nonserializable status if the object isn't serializable). Note that there are a lot of similar such utility pages around on the 'Net, including one from IBM support that inspired this one; it's hardly unique. (Note that I did not see any code used in the versio from IBM support; this is entirely homegrown.) However, this one may prove useful if you don't already have one. Please send joeo@enigmastation.com any feedback or suggestions you have; note that right now it uses a very simple format for the output of the session object, so showing an array stored in session isn't very useful (yet). If you need more functionality, please let me know or send any updates you might have. This page is licensed under the GPL.
Copyright © 2007 IronFlare AB