Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Object Usage  RSS feed

 
Sathiya Rajamanickam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

[ March 25, 2005: Message edited by: Sathiya Rajamanickam ]
[ March 25, 2005: Message edited by: Sathiya Rajamanickam ]
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sathiya,

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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!