Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2523

evict by OID is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • JPA 2.3.0

    Description

      I cannot seem to get the evict by OID working. When I use evict by class that works, but what I really want to do is to just evict a single entity.

      Here is my scenario:
      1) Bean managed EJB uses a native SQL to modify an Entity. This does begin & commit.
      2) After the commit it makes a call to another EJB, but that call is returning stale data.

      I have tried:

      OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
      kem.getEntityManagerFactory().getCache().evict(X.class, id);

      But that doesn't work, but this works:

      OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
      kem.getEntityManagerFactory().getCache().evictAll(X.class);

      Am I the only one having issues with evict by ID?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              byoder brian yoder
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: