• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

===Database/Session Problem!===

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i m confused now!
i have developed a web application based on MVC pattern.
i have 8000 records to show;
and per page i have to show only 10 records;
wht am i suppose to do..
hit the database for every next 10 records
or get the result set into vector and put the vector int session;
i m currently putting the whole thing into session and iterating thought the session;
works fine;
but i m not satisfied!!!
please someone help me!!!
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
interesting question... I've written a little worksheet class that iterates through a hashtable of string[] (fields)(this is probably a really bad design, but hopefully someone smarter than me will let me know that this is the case :-)) based on a particular 'pageStartRow' and 'pageRowCount' which lets the user hit a prev or next to iterate through the table (or type in a row # to goto)... so Hrithik, I also just dump the entire table into the session...
Just to pile in on Hrithik's confusion... are there pretty robust free worksheets out there? I had specific onclicks that I needed to handle, as well as custom queries that I had to process (by including a filter in the header of the worksheet). Are there aesthetically pleasing, light, intuitive worksheets?
Thanks in advance...
[ February 15, 2002: Message edited by: matt horton ]
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ive run into this problem a few times with different results coming back from a db & what Ive found that works best & is best for saving memory & system resources is to code LIMITS in the query (in your case 10 per page) The I add a next button to the page with the initial query in a hidden field (or session) to send to the next page. Once I grab the query I simply increment the start & end limits in the query before hitting the db (yes it requires a hit every ten results)
I ended up doing this because I noticed real memory problems with trying to throw thousands of rows of a result set into sessions. Once I had 50 or 60 people doing this the system resources REALLY got low. Its really a lesser of two evils if you ask me but I think Id rather hit the db then slow the system down to a crawl.
 
reply
    Bookmark Topic Watch Topic
  • New Topic