This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes caching master tables static data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "caching master tables static data" Watch "caching master tables static data" New topic
Author

caching master tables static data

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
All,

I am currently working on a webservice application using java 6 along with its inbuilt JAX-WS feature and JPA(Hibernate). The java based computational application is very database intensive and we have a lot of database roundtrips. A significant piece of these database roundtrips are to fetch master data spanning acros a bunch of tables which is static in nature and at most can change once in 2 years.

We feel the master data is a good candidate to be cached in memory rather than retrieved from the database for every web service call.
My question is as part of the webservice lifecycle at what point can i trigger a call to pre-load all the master data and cache it. Also it would be good if experienced folks in the caching space can shed some light on how to go about caching all the master data in an eager fashion using JPA Hibernate


Regards,
Anantha Sharma
Ranch Hand

Joined: Sep 01, 2010
Posts: 43

you could try using EHCache to cache the table contents..
since you are using hibernate the cache configuration is extremely simple (as is with non hibernate projects)..

please refer to the EHCache site for more details on how to configure the cache & the hibernate docs to understand how to get hibernate to efficiently use one.

use this link to findout more on how to configure hibernate with ehcache


revert for any clarifications..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: caching master tables static data
 
Similar Threads
Java desktop database app with JPA and Hibernate
Spring JDBC Vs Hibernate?
Use Of InitialContext for Caching
Populating JPA managed Entity from non-JPA managed entity
Does the persistence layer know when the database has changed?