Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of The Software Craftsman this week in the Agile forum!
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: 5885

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: 16540

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
Have you tried LearnNowOnline?
subject: Access Cache Memory