Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Caching with JPA/Hibernate  RSS feed

 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Spring ,JPA/Hibernate in my application and have implemented a Service Interface and Class and DAO(with generic DAOs) to compute totalLineNumbers.

Any my requirement is to include caching.
Now i have very little knowledge to caching using JPA/Hibernate. And i know JPA has separate API for level 2 Cache.

Any suggestions ,what level and how can i implement caching in this.

This is for a search portal and linenumbers might change only if some re-indexes ,republishes the projects.
If its not changed, it need not to recompute the count again.

Thanks .
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Caching is already implemented when you have started using JPA/Hibernate ! JPA/Hibernate behaves exactly as you would like it to behave.
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I assume you have looked at the hibernate docs on caching. I have used the ehcache implementation and found it quite easily to integerate into existing code.

Is this the kind of caching you are looking for?

Sean
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!