Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access Cache Memory

 
SaravanaKumar Venugopal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
There is a requirement in our project to export a table as PDF, so for implementing we have a DB hit for loading the values in table as one struts action file, and for implementing export functionality we used servlets.

In the servlet class we made again DB hit which we dont want to do, is there a way to access the cache variable which has been loaded as a table in the client side and if the client side cache variable then we will have DB hit.

Or any other option for this implementation is also welcome
 
Junilu Lacar
Bartender
Pie
Posts: 7795
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SaravanaKumar Venugopal wrote: is there a way to access the cache variable which has been loaded as a table in the client side

I don't think it works the way you guys think it works.

Most important question: Did you come to the decision to optimize based on the results of profiling your application or just a gut feeling? If you answer "profiling", read on. If "just a gut feeling," you should profile your application first; optimization based on "gut feeling" is often a waste of your time and your employer's money.

Assuming you have already used a profiler and load tested your application to prove that there is a performance problem in the PDF export functionality, then you should look at caching the results of the query on the server side. Search for "caching db query results in java"
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch!

Actually, if you're using an ORM such as EJB or Hibernate, database caching is pre-supplied as part of the product.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic