Session Object Usage

Sathiya Rajamanickam

Greenhorn

Posts: 5

posted 12 years ago

I have an Doubt in Session Object. Can i Store large String-array Into Session Varible. bez String Array is getting values from Text(ini) File. The Page may be call itself more than once in the same Session. But I dont want every time values load from the Ini file. Is it affect the Performances of the Server Please advise me

I suppose that the values into the ini file don�t change very often. Also it looks to me like the data is user independent, which means that you need to cache the same values no meter what user logs in. In this case your problem will become one of choosing the right caching strategies. One of the fastest solutions I can see is to cache the data into the application (session) context object, rather than every user session. This needs to be done only once through the application lifetime. Another similar solution could be to write your own singleton CacheManager class and define a way to initialize the cache when the server starts (using a startup class, or a servlet configured to be loaded at start up, etc). You might look for implementing vendor specific solutions: weblogic for example provides a special jsp tags for caching the data, like this:

This will cache your data within this tag for an amount of time specified by the scope attribute. Regards.