Uploaded image for project: 'Spring Modules'
  1. Spring Modules
  2. MOD-488

@CacheFlush not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9
    • Fix Version/s: None
    • Component/s: CACHE
    • Labels:
      None
    • Environment:
      Java 1.6, Windows, Tomcat 6

      Description

      Hello

      In the following class, the findAllProducts() method works fine and the results list is cached. However, if a new "Product" is created then the cache is not flushed.

      public class ProductDAOImpl implements ProductDAO {

      @PersistenceContext
      private EntityManager em;

      @Override
      @CacheFlush(modelId = "productCacheModel")
      public void create(Product product)

      { System.out.println("Create product"); em.persist(product); }

      @SuppressWarnings(UNCHECKED)
      @Override
      @Cacheable(modelId = "productCacheModel")
      public List<Product> findAllProducts()

      { return em.createNamedQuery(FIND_ALL_PRODUCTS).getResultList(); }

      }

      Regards

      Mark

        Attachments

          Activity

            People

            Assignee:
            yatesco Colin Yates
            Reporter:
            markandirene Mark Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: