Link Details

Link 1018057 thumbnail
User 383951 avatar

By tamanm
via tamanmohamed.blogspot.com
Published: Aug 21 2013 / 08:30

The default behavior of EntityManager is using cached results from a database query, and you want to force a query to be executed each time a table is loaded, rather than allowing the results of the cache to be displayed. Especially when you are working with database stored procedures, which changes the data on database server, but when you query this data, cached one is displayed, instead of new changed data. There was a solutions by Disabling the cache from persistence.xml or Calling EntityManagerFactory.getCache().evictAll(); method in an Interceptor, I was using this solution. more on article....
  • 3
  • 0
  • 463
  • 612

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Upvoters (3)



Downvoters (0)



    Apache Hadoop
    Written by: Piotr Krewski
    Featured Refcardz: Top Refcardz:
    1. Play
    2. Akka
    3. Design Patterns
    4. OO JS
    5. Cont. Delivery
    1. Play
    2. Java Performance
    3. Akka
    4. REST
    5. Java