Question

I have a small JSF web application on WAS7.0 with just one page but a fairly large user base.

Can i declare all(1) beans as request scope and also use javax.faces.STATE_SAVING_METHOD client without running into memory issues on the server using a non expiring session?

How would that work for larger applications?

Reason: I am trying to work around an issue in WAS7.0 quickly while IBM deals with my PMR.

Edit: At this point i do not have the resources to try and measure it myself and would leave the app as is (hoping not to annoy too many users).

Was it helpful?

Solution

You don't necessarily need to change the bean's scope. Just keep the beans in the scope they belong in. Only if you're abusing session scoped beans to hold request or view scoped data, then the story indeed changes. Request or view scoped data belongs in request or view scoped beans, not session scoped beans. The session scoped beans should only be used to hold session wide data, such as the logged-in user, its site-wide preferences, the chosen language, etc.

Changing the state saving method from server to client will definitely fix the ViewExpiredException on views whose backing session is been expired. It will decrease server's memory usage but it will increase server's network bandwidth usage. But if you're already using GZIP (or weren't already; so turn it on as well), then the impact is pretty minor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top