Thank you for this clarification. So it appears that, in an unclusterd 
context, the problem is not with storing references *in sessions*, but 
simply with storing references. I am using hibernate objects and I need 
to keep to copies of the data, so I am creating a value object plus I 
keep the original hibernate object. Perhaps I would better create 2 
value objects and throw away the hibernate object (in case this object 
is much bigger than a simple value object??). I must check for this. 
(But this is not Wicket related ;-).

Thanks again


Eelco Hillenius a écrit :
> On 9/12/06, Pierre-Yves Saumont <[EMAIL PROTECTED]> wrote:
>> Matej, I do not understand your point :-( The object does not get
>> replicated when a reference to it is stored in the session. So I
>> understand point b, but in case no clustering is used, why would there
>> be a memory problem? Putting a reference in the session is just a way to
>> keep a handle on the  object. Having the reference the session is not
>> different from having it anywhere else, as far as memory is concerned.
>> Or is it?
> That,, of course, depends on where that object comes from and how long
> lived it would be if it were not put in the session. For instance, if
> you have some objects you get from an ORM (like Hibernate), they
> typically only have to exist for a short time, e.g. during a
> transaction, interpreting the results of a query, etc. Usually, this
> means that such objects live for one request. However, if you
> references to such objects in your components or models, they'll live
> as long as those components/ models live, which might be for the
> duration of the session. But if you would store e.g. only the ids of
> those objects, or the query to get them or just a reference to a
> service that knows how to get them, you'll use less memory. This is
> the main reason we have detachable models.
> Replication, like you said, only happens when you run in a cluster
> *and* you use http session replication *and* you use http session as
> session store (HttpSessionStore) *or* when a server tries to persist
> sessions e.g. on shutdown so that on startup it can pick up it's
> sessions again.
> Eelco

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list

Reply via email to