This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

How does a cache holds a record set  RSS feed

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, most caches including EhCache works like a Java map (ie key value pair). But it's typically used to cache database records which are returned as a row with multiple columns.
So how does it work? The key for the cache is holding the rowname, and the value is holding say an array which contains all the columns? Or for each row you have an array of these key-value pair, where the keys are the column names and the values are the cell values?
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either approach is possible, and I'm sure one could come up with yet more designs. What is most suitable depends on the circumstances. Does it matter how it's done, as long as it works? (Which is my snarky way of asking: "What prompted this question?" :-)
 
Mike Cheung
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay and is that how it's typically used? The reason I'm asking is because it seems to be a rather non straight forward way of storing results returned from a database. If it's like that why don't I use a vector of vector instead?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!