-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Re HttpSession: Transparent Object<->Identifier Marsha
PostPosted: Wed Nov 05, 2003 6:58 pm 
Regular
Regular

Joined: Tue Sep 16, 2003 11:35 am
Posts: 93
Location: San Francisco, CA
Hi,

So I have a large domain with around 40 persistent classes (x 10-100,000 instances). The objects are connected in such a way that almost the entire database is linked together in one giant object graph. I use factory-level caching, which works quite well to reduce the load on the database.

I'm using a Servlet container and there are a few cases where I'd like to put some of the objects in this graph on the HTTP session. These situations are usually one of the following:

1. As a convenience I want to stick a single, or collection of persistent instances on the session so I can retrieve them later ...
2. I'm in the process of creating a new persistent instance. It is not actually persistent yet but it has pointers to persistent data.

At first I wasn't aware of how much memory overhead this was adding to the container. When the load went up and the server went into swap death repeatedly I realized that each HTTP session was taking 1MB or more of memory since each session was holding a copy of the entire object graph.

In case 1, it is easy enough to put the object identifier (class/id) on the session instead of the actual instance. Marshaling can even be handled transparently using the HttpSession interface.

However, I haven't figured out a nice solution for case 2. The only thing I have come up with is very messy: to save the pointers as identifiers in another session attribute or to make the new instance "aware" of both pointers and identifiers, or to alter the data model and save an unfinished instance to the database. What I'm looking for is a more transparent way of handling this stuff. Perhaps there is a way of associating the new instance with the session factory without writing it to the database.

Any suggestions?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.