aspose file tools*
The moose likes JDBC and the fly likes ideas on caching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ideas on caching" Watch "ideas on caching" New topic
Author

ideas on caching

osman cinar eren
Ranch Hand

Joined: Jan 25, 2005
Posts: 78
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.


SCJP/SCWCD
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Get the latest state.
Or I'm not getting you?
osman cinar eren
Ranch Hand

Joined: Jan 25, 2005
Posts: 78
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

Joined: Aug 13, 2004
Posts: 1081

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 ]

Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
osman cinar eren
Ranch Hand

Joined: Jan 25, 2005
Posts: 78
so what should i do?

how is it done in javaranch or similar pages?
Any ideas?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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
 
subject: ideas on caching