Hi Marcus, The best solution depends upon the scalability vs performance tradeoff you want.
If you want an app that will scale to many thousands of concurrent users, then reloading on each request may be best. It adds more load on the cpu, but doesn't need memory on the server. However if you have a smallish number of users but want better performance then yes caching the db request data is best. But as you say, using the session sucks. For many reasons. Having data remain in memory across a sequence of operations is called "conversation scope", and there are a number of libraries that add conversation scope to JSF. The ones I know of are: * Apache MyFaces Orchestra * JBoss Seam * Spring WebFlow * Apache Shale Dialog In all cases, these libraries make it easy for the data to be discarded when no longer needed (when the user moves off to some other part of the app). The Apache MyFaces Tomahawk library "t:saveState" tag is like a very simple conversation-scope; it works for simple cases but, as you have found out, it is not an elegant solution when there are many beans or many pages that need to hold data in "conversation scope". Regards, Simon [EMAIL PROTECTED] schrieb: > > Sure, to make all beans session need many resources that’s the problem. > > *Von:* [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > *Gesendet:* Montag, 17. März 2008 11:20 > *An:* [email protected] > *Betreff:* RE: Bean Scope Problems > > Is there any reason you want to make the beans request? > > The values you required for all the request can be put in the session > and keep all the beans as request. I mean create sepearet data model > and save it in session. > > ------------------------------------------------------------------------ > > *From:* [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > *Sent:* Monday, March 17, 2008 3:47 PM > *To:* [email protected] > *Subject:* Bean Scope Problems > > Hi! > > Every JSP has his own bean and I want that this beans have a scope of > request, but if I really set request scope on every request database > data get loaded = many database transactions. > > So whats the correct way? > > Save database data on a separate bean which have session scope or used > t:saveState and other beans get data from this bean or I have to use > t:saveState for all beans? > > I hope you understand my problem – whats the best way do to this? > > Regards > > markus > > The information contained in this electronic message and any > attachments to this message are intended for the exclusive use of the > addressee(s) and may contain proprietary, confidential or privileged > information. If you are not the intended recipient, you should not > disseminate, distribute or copy this e-mail. Please notify the sender > immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of > viruses. The company accepts no liability for any damage caused by any > virus transmitted by this email. > > www.wipro.com >

