java - Force clear EJB3 cache in Glassfish -


I have an application written in Java which is using EJB3 + toplink. I am using glassfish as my app server.

Occasionally the data is cached, and I have to manually clean my cache. I think we can set the time to clear it, but I would like to create a button that will clean it for me, what is it possible to do?

Apparently you can refresh the cache with the query of your database using this code Are:

  query query = em.createQuery (sql.toString ()). SetHint ("toplink.refresh", "true");  

This works for me.


Comments

Popular posts from this blog

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

excel - Populate list via a bi-Condition -