This is dependent on how you have structured you database query. There are multiple solutions to what you are attempting to do.
1. Create a query that will return the entire resultset and store that resultset in the session as you metion. If you are returning an extremely large result set, running the application in a clustered environment with percistant sessions to a database, or have a large number of users, this could prove problematic. The more you put into the session, the more memory your application will use. Additionally, if you persist your session, you are requerying each time you mention a session. This could be a mojor performance hit. Finnally, you are moving a lot of data across the network. If 90% of the users will find what they need on the first 1 or 2 pages of a resultset, pulling back the data to populate the reset of the menus is a waste of resources.
2. If all users are going to use the same resultset (ie multipage menuing or a product catalog), this may be a occation for a singleton class with a collection containing the data. You could refresh this singleton based on a timeframe to insure it remains current. this will only work for semistatic results.
3. Implement a fast lane reader pattern. This will subdivide your SQL results to return only the page that is being displayed using boundry conditions in the SQL or Stored procedure. This will require a database hit between each page, but if the database is properly indexed and you are using a connection pool, you can still retain very fast performance.
I am sure there are many more ways to address this problem, but these are the three that I have had the most experiance with. It boils down to ever situation is different and you have to customize your solution based on the data, the business requirement, and the user habits.
Phani <[EMAIL PROTECTED]>
07/07/2005 06:19 PM
|
|
Hi,
Shud my Action form be in session scope if I want to
specify pagesize in display tag for paging..
Because I get the following error:
Error 500: Cannot find bean storeForm in any scope
Thanks,
Phani.
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]