This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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


Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 19351
    
  10

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: 62127
    
  68

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
 
I agree. Here's the link: http://kickstarter.com/rocket-mass-heater
 
subject: session and application scope object in memory?