views:

469

answers:

1

I have application written in Java that is using EJB3 + Toplink. I'm using Glassfish as my app. server.

Sometimes the data that has been cached is old and I need to clear my cache manually. I know that we can set time to clear it, but I would like to make a button that will manually clear it for me. Is is possible to do?

+2  A: 

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

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

This works for me.

Maksim