This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ideas on caching

 
osman cinar eren
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i need a strategy for the following problem. There is a JSP page that shows the results in an HTML form. However as the items to be shown are so large, they need to be shown on page by page.(as forums in javaranch)

getting all of the results and caching on the server does not seem fine.
how can we use SQL taking into account the fact that records can be deleted and added during the page selections?(there is an auto-increment ID(PK) field for the records)

what is the strategy for such a problem?



thanks in advance.
best regards.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get the latest state.
Or I'm not getting you?
 
osman cinar eren
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have 1000 records to display 10 by 10.
do you recommend to take all the 1000 records and hold them in memory(in the session) and show 10 by 10?

i dont think this is a good idea? what if there is 100000 records?

could not I tell the problem?
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by osman cinar eren:

i dont think this is a good idea?



Yes it is not good Idea don't do this

Originally posted by osman cinar eren:

do you recommend to take all the 1000 records and hold them in memory(in the session) and show 10 by 10?


It is not recommended to do this. consider a case when user has opened 2-3 instances of jsp in different IE windows and viewing 10 record, you can never predict when user want to click next for viewing next 10 records.
how long you would be holding same data in memory

Shailesh
[ May 04, 2005: Message edited by: Shailesh Chandra ]
 
osman cinar eren
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so what should i do?

how is it done in javaranch or similar pages?
Any ideas?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can search the same forum or JSP forum for paging. There are lots of threads discussing the same.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic