aspose file tools*
The moose likes Servlets and the fly likes Storing large data in session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Storing large data in session" Watch "Storing large data in session" New topic
Author

Storing large data in session

jayram
Ranch Hand

Joined: Oct 30, 2000
Posts: 94
Hello
My application needs to cache a large amount of data. I can do it at application scope or at session scope in JSP.But i think it will degrade performance as it might consume lot of RAM. This data is as good as static and i dont want to go back to database to get same data.
Please suggest me alternative ways of doing same thing.
Cheers
Jayram
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12683
    
    5
Is this data serializable? If so you might keep a weak reference to it, that way the GC could remove it if necessary. See the java.lang.ref package.
Bill

Java Resources at www.wbrogden.com
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Why not write it out to a temp file that is destroyed on session close?
I'm not sure what the performance issues are about writing but for the reading you could then use a BufferedReader.
Comments anyone?
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing large data in session
 
Similar Threads
EJB and data sharing
Doubt in Setting the session scope as Application
Reusability of ValueObjects in Struts
JSF navigation questions
spring global session scope