File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Access Cache Memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Access Cache Memory" Watch "Access Cache Memory" New topic

Access Cache Memory

SaravanaKumar Venugopal

Joined: May 12, 2012
Posts: 20
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

Joined: Feb 26, 2001
Posts: 6529

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"

Junilu - [How to Ask Questions] [How to Answer Questions]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Access Cache Memory
It's not a secret anymore!