I recently took over a supporting project where one of the web applications is performing very badly in terms of loading the page with data. Upon troubleshooting, I found out that the number of records it pulls from DB is 8541 and stored in a list called originalList
. Then the list is filtered based on certain conditions and stored in a list called filteredList
with the count of 2170. Both these lists are stored in session objects. The filteredList
is then shown on the screen. For this entire process, it takes more than a minute because of which its getting timedout sometimes (Please note that the max timeout is set to be 1 minute on the proxy server and we cannot changes that). This happens during on-load of the screen and no manual intervention.
Reason to store both the lists in session is: The screen also has some search criteria where user fills up certain search boxes and clicks the search button. System is trying to filter the data from these the list called originalList
based on the search criteria, instead of fetching the data from DB. This is triggered by user.
Questions:
- Is it advisable to store large amount of data in the session?
- Why is it taking more than a minute for just loading the ~2000 records on screen?
- Will the large amount of data in session impact the data getting loaded on the screen?
- Is it ok to change the design to get the data from DB instead of accessing from session when the search is triggered by user?
Technologies used:
- SQL Server
- Java 1.6
- Struts 2
- Plain JDBC (No ORM frameworks)
- Plain JavaScript (No jQuery)
As it is developed in a very old fashion, I cannot change the frameworks.