1

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).

Stefan
  • 838
  • 3
  • 13
  • 28
  • Surely *it's possible*. Just try, test, measure and conclude. But what exactly is it, the problem you're trying to solve? This question is otherwise way too broad and rhetorical. – BalusC Dec 02 '11 at 17:57
  • Behaviour of View expiration has changed between WAS6.1 and WAS7. If users leave my page open(which displays results for a single request on the page itself) and try to submit a new request after the session expired they get a ViewRestore exception page instead of either the page refreshed or the request processed. I tried several solutions on the web but none works so far. I have opened a PMR with IBM but they usually take weeks. – Stefan Dec 02 '11 at 18:01
  • You can poll or ping your page from time to time, too. Maybe a periodic ajax request, to maintain live your session. – gorlok Dec 02 '11 at 18:04
  • My concern is not so much the expiration of the page, but that it is visible to the user. I dont need to keep a session at all, since its just a request + response(on same page), but for some reason in WAS7 it wants to display an annoying message now. – Stefan Dec 02 '11 at 18:26

1 Answers1

3

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thanks works like a charm. And btw i wouldnt know how to do my job if not for all your answers on stackoverflow and your blog :D – Stefan Dec 05 '11 at 19:30