1

We are using JSF with Primefaces on a IBM Websphere 8. My problem is, that if I have more Conversations in JSF, the ViewState expires. If a user works on two conversations and navigates to many pages, the buffer for viewstates (default 20 slots) is full and viewStates of the other conversation are deleted. So if I go back to the first conversation the viewState isn't there and I cannot work any more on this conversation.

Is there a posibility to save ViewStates in conversation or any other workaround? Setting javax.faces.STATE_SAVING_METHOD to client is not the best solution I think. Increasing org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION dramatically is also not a really good solution, because of many sessions expected.

anm
  • 545
  • 3
  • 17
  • *Setting javax.faces.STATE_SAVING_METHOD to client is not the best solution I think* why you think that? – Luiggi Mendoza Nov 06 '13 at 17:14
  • Because it causes a lot of traffic? – anm Nov 06 '13 at 17:16
  • Have you measured how much traffic you will get from it and stated that this won't be the solution? – Luiggi Mendoza Nov 06 '13 at 17:19
  • I just tried on one view - setting it to *server* I get a size of about 13kb (without any resources, plain xhtml), with setting it to *client* I get a little over 1MB. So it's about a 77 times greater traffic! Even if we consider 50 times more, thats too much, it also costs a lot of time sending a view to the user! – anm Nov 06 '13 at 17:25
  • @anm - perhaps you need to think in the direction of redesigning your pages/webapp. You're probably keeping too many things in the session or you have unnecessarily bloated pages. Slimming those down will reduce the bulk of individual sessions and possibly the viewstates – kolossus Nov 07 '13 at 13:58
  • @kolossus - this is a webapp with many users. Also a small increase in traffic would cause a slow down in our network. Our pages are optimized to reduce traffic - so I think it's no oppinion to send the viewstate to the client. And yes, we have a lot of things in our session and we have a conversation too - bit it's not possible to reduce the size dramatically - we already reduced the size really much, more isn't possible any more. I cannot believe, that this is the only possible solution... – anm Nov 07 '13 at 14:32

1 Answers1

0

We solved it on our own. We take a PhaseListener and organize the views, so each conversation gets only one view-slot. Thats possible, because we disabled caching and so we do not need more than one view per conversation. Caching disabled is needed in our applications.

anm
  • 545
  • 3
  • 17
  • Just for you info: you need more than one viewState if you process more requests parallel or you do not update the viewstate in the page. We need more ViewStates for example for Dashboards, Downloads, Deffered Loading etc. – anm Mar 18 '14 at 16:25