• Post Reply Bookmark Topic Watch Topic
  • New Topic

Caching approach suggestion required  RSS feed

 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am working on web application development.
There is DB stored procedure which fetches (let's say) 100 Products from Database. Each product has 40 fields. There is pagination on web page (JSP) which allows User to move one product at a time. So , for the first load, first productdetails (all 40 fields are shown). Then, user clicks on Next (button in pagination section) , next Product is fetched from DB and shown to User. Product is pretty static.
I want to use Cache layer in between which shall allow us to cache DB calls (Stored procedure calls) so that when product details is again requested by User, we show data in cache.

So, I want to which open source (free) Java based framework available which I can use in this scenario.

Thanks in advance
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhay Agarwal wrote:So, I want to which open source (free) Java based framework available which I can use in this scenario.

To be honest, I'm not actually sure that you need one.

AFAIK, most ResultSets are "cached" (at least in the way I think you mean), which is why they can be a bit awkward to use.

For example: If you run a "SELECT *" from a million-row table, the ResultSet will NOT contain a million rows (at least not to begin with). It will contain some number (or size) specified by the JDBC driver, and then, as you move down it, the db will supply more rows as needed. I believe you can also tune these parameters, but I'm not exactly sure how.

My worry - if you start trying to implement a complex "custom row caching" algorithm - is that you'll simply be duplicating something that the db already does for you.
And, as they often say in programming: Don't re-invent the wheel.

Winston
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!