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
  • 420
  • 607

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.

Voters For This Link (3)



Voters Against This Link (0)



    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax