[jboss-user] [JBoss Seam] - Re: Scope and Best Practices
fhh
do-not-reply at jboss.com
Sun Apr 15 18:30:49 EDT 2007
anonymous wrote :
| I can see how its not scalable to keep a large data model in memory for the duration of a user's session, but it seems equally non-scalable to query the database each time the user interacts with the page it supports.
|
I consider both bad practice. You should only fetch the data you actually need - not the whole data from the database. If you're resultset is large you should scroll over the resultset and fetch only the data actually displayed.
This is where converstations come in. You can have different subsets of a resultset to display in different windows. This is not possible with session scope as the results would overwrite each other.
The other advantage is that you can "clean out" the conversation context with a single annotation while you have to remove components from session scope explicitly.
However sometimes you do want that data is shared between different browser windows. This is were you have to use session scope.
anonymous wrote :
| I thought I'd ask the users how they use Scope?
|
IMHO it boils down to this: If your user is only using a single browser instance and you never and your long running converation performance will be exactly like using session scope. If your user uses multiple browser windows to access your application that do not share data you have to use conversations. If you end conversation now and then you will save memory compared to using session scope you do not clean.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037402#4037402
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037402
More information about the jboss-user
mailing list