This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 16
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: 4442

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

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.
I agree. Here's the link:
subject: Access Cache Memory
Similar Threads
cache could speed-up IE rendering?
Hibernate second level caching
applet db access mediated by jsp db access
Wait for the Server Output to complete
NX: What is the point of multiple instances?