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
Post a Comment