This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Originally posted by Rushit patel: I just changed my project and the new project I am going to work has huge huge usage of HTTPSession . Can some body tell me how can I replace it ..
Is this your plan . You are going to heavily use HTTPSession and replacing it(HTTPSession) with something else would improve performance. I do not think so.
HTTPSession are ready to use stuff to store user specific data , but yes , try to avoid putting unnecessary objects into it.Better to keep it small and as soon as work of an object is over , remove it.
Web applications often have to hold some information about the user for the time the user is browsing the site, say a shopping cart with several items in it. Designers have many choices about where to put such data. Here are a few:
1. In Java or COM objects in memory 2. In server "session" storage 3. In a cookie 4. In hidden fields on the HTML page 5. In an XML data island on the page 6. Encoded on the URL 7. In temporary session storage on a database 8. On the real database of record
Give you any ideas?
I worked one vendor framework that put too much on the session and caused memory problems. Some of it was really dumb; copies of very large objects that were never really used again, but we had a difficult time pruning others off. Once it was small enough, we turned on the WebSphere option to store sessions in the database to support clustering.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
It sounds like you've already come to the conclusion that the heavy use of session binding is a bad thing. Have you done any testing to prove this? Is this really a bottleneck to performance or are you just assuming that the heavy use of the session object is bad?
In certain types of apps, proper use of the session object can greatly improve efficiency by cutting down on redundant object creation, disk I/O, and/or database access. [ September 13, 2007: Message edited by: Ben Souther ]