• Post Reply Bookmark Topic Watch Topic
  • New Topic

Clear the cache

 
Padma Priya
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am new to the concept of caching.

I am trying to clear the cache using




I do a change in the database and then trying to invoke this. But i see the same onld stale data. Can you please point me to what further steps need to be taken to clear the cache.

Thank you in advance for the help

Thank you!
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should work. You also need to call clear() on your EntityManager or create a new one.

In JPA 2.0 you can also just use,

emf.getCache().evictAll()
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!