File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access Cache Memory

 
SaravanaKumar Venugopal
Greenhorn
Posts: 20
  • 0
  • 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: 6532
21
Java Linux Mac Scala Spring
  • 0
  • 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
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic