[ 
https://issues.apache.org/jira/browse/OPENJPA-2523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

brian yoder updated OPENJPA-2523:
---------------------------------

    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?

  was:
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().getStoreCache().evict(X.class, id);

But that doesn't work, but this works:

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

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


> evict by OID is broken
> ----------------------
>
>                 Key: OPENJPA-2523
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2523
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: JPA 2.3.0
>            Reporter: brian yoder
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to