aspose file tools*
The moose likes Servlets and the fly likes Session Tracking in Web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Tracking in Web application" Watch "Session Tracking in Web application" New topic
Author

Session Tracking in Web application

Debashis Mandal
Greenhorn

Joined: Feb 04, 2013
Posts: 5
Hi everybody,

In my web application, the architechture is:
JSP(view) ->servlet-> Business Class (to implement the business logic which in turns call DB to get the data).
Same way reply back to a new JSP to show the result.
Now, we have to show result in table in some JSP with 100 records at a time and there are 2 buttons next and back. So when user click on the next it will show next 100 records on the page. There are huge records in the DB. So what we plan is to fetch 1000 records from DB at a time and keep it in List object in Business class and send 100 records from this list to JSP to show. Then when next request come to show next 100 records for same user same session it will give next 100 records from the list and so on.
My question is how to maintain this list through out the session in back end. Now as this list is huge so we can not put it in session object to make client side heavy.

Any suggestion!!
Thanks in advance!!
DM
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
You appear to have decided on this "optimization" without making any measurements or considering how the client will use the data.

How is a user going to approach this data?

What are they looking for in these HTML pages of 100 records?

What is the comparison between the amount of time a user would stare at a page of 100 records and the time required to retrieve the next or previous 100?

How many users will be interested in the same data set?

Bill
Debashis Mandal
Greenhorn

Joined: Feb 04, 2013
Posts: 5
Hi Bill,

Thanks for looking into it.
To answer your question:
1. First there is a search page, where user will select the criteria. Based on this criteria data will be selected from database.
This is an internal application of a company, where the manager can log into the system and search for some employees. Search criteria are:Name, Role, Skill Set etc. Now if user select Skill Set as search criteria it may select multiple employee and result can be more than 100.
The access will be given to all managers and in fully running condition at a time more than 5000-10000 user can use this.

Let me know if you need any further info.

Thanks,
Debashis
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Debashis Mandal wrote:Now as this list is huge so we can not put it in session object to make client side heavy.

This shows that you do not understand how sessions work. The session data is not maintained on the client.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18675
    
    8

So from the user's point of view there's a "huge" list and they can scroll through it 100 rows at a time?

Hopefully "huge" isn't going to be much bigger than 1000, otherwise the unfortunate user is going to have to click "Next" far too many times. Personally I would just display the 1000 rows to the user and let them use the browser's search function to find what they want.

Or if "huge" is a lot bigger than 1000, then you haven't designed the system right. Giving the user an enormous data dump and making them go through it is just user-hostile. Ask the user what they want and do the searching on the server before you return a non-huge list of results for them.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Now lets consider the question you did not answer:
What is the comparison between the amount of time a user would stare at a page of 100 records and the time required to retrieve the next or previous 100?


How long does it take to do a typical query on your system?

Personally, I would not mind if, after spending a minute or so scanning 100 records, it took 5 seconds to recover the next 100.

Also, consider this - if there are really that many potential users, suppose user A modifies a record but user B still browses in your cached 1000 records.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Session Tracking in Web application