File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes session and application scope object in memory? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "session and application scope object in memory?" Watch "session and application scope object in memory?" New topic
Author

session and application scope object in memory?

adam spline
Greenhorn

Joined: Sep 29, 2010
Posts: 18
Hi all,

This might be a silly question, but I could not find an exact answer.

When you place an object into a session (session.setAttribute), is that object stored in memory on the server or is it serialized to disk?

Same question with placing objects into the application scope? Thanks for all your java help!

-Adam
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

All Java objects are always placed in memory, regardless of what words you use to describe the context in which they are created. That's just a basic fact about Java.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61298
    
  66

Memory. Under certain circumstances, session values might be serialized (cluster sharing, for example), but they are always held in memory.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
adam spline
Greenhorn

Joined: Sep 29, 2010
Posts: 18
thanks everyone for the clarification.

-Adam
 
Don't get me started about those stupid light bulbs.
 
subject: session and application scope object in memory?