wood burning stoves 2.0*
The moose likes Struts and the fly likes Running out of session object storage space? 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 » Frameworks » Struts
Bookmark "Running out of session object storage space?" Watch "Running out of session object storage space?" New topic
Author

Running out of session object storage space?

Andrew Edwards
Greenhorn

Joined: May 18, 2004
Posts: 10
Hi,

I am currently working on a struts project using OJB as my persistence layer. My concern is I and am finding I sometimes have quite large objects (notably the current logged in user) stored within the session object. Is there a way I can either monitor or increase the size of this storage space?

I'm not sure if it is down to bad design on my part. The user object for example contains a collection of all the account objects the current logged in user has access to along with a collection of permission objects for each account. A user with access to a lot of account (or worse all of them!) may create a large(ish) object for the session to store. I may have to refactor this into something more efficient with less storage requirement at the cost of more database lookups along the way.

I am worried with a few too many logged in users I may have have out of memory exceptions or similar.

Can anyone who has come up against similar offer any advice?

Thanks, Andrew.
[ January 15, 2005: Message edited by: Andrew Edwards ]
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
If you have "account objects" that are going to be common to all (most) and they could be shared maybe you could store them in the applications scope?

If the objects aren't needed on most pages why carry them in the session?
If they're needed of a certain range of pages maybe you could remove them from the session when the user navigates away from this area?


-Tad
Andrew Edwards
Greenhorn

Joined: May 18, 2004
Posts: 10
I think storing some common objects in the application layer is a good one. Although I think a lot of my problems stem from initial nuances of the way OJB maps objects and relationships with the database. Although it shouldn't, using it as a persistence layer does seem to guide class implementations and structure slightly. This might be my fault though as this is my first time using OJB.

I think a bit less initially stored within the user object and a couple more real-time database lookups to fill in the gaps at execution time should solve most of my issues.

Thanks for the help,

Andrew.
[ January 15, 2005: Message edited by: Andrew Edwards ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running out of session object storage space?
 
Similar Threads
Info about clustering
Tag Library and Struts Framework
custom security and HttpSession access
How to prevent duplicate logins
This weeks giveaway : "JSP Examples and Best Practices".