Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] BEFORE INSERT trigger modifies a column --> doesn't refresh in EclipseLink

here are a few options

1. kick the entity out of the cache

em.getEntityManagerFactory().getCache().evict(Contact.class, contact.getId());

2. take a look at @Cache(alwaysRefresh = true)

3. take a look at the query hint eclipselink.refresh


more info can be found at http://wiki.eclipse.org/EclipseLink/Examples/JPA/Caching


Cheers,
Derek Knapp


On 10-11-24 02:24 PM, Bálint Kriván wrote:
Hi!

I have a column which is managed by a trigger in DB (Oracle 9i (production)/10g (dev)). But when I try to use the getter method to access this property of the object I'm getting null. When I redeploy my application it works, because EclipseLink cache is being purged (My application persisted the object as this property would be null, but trigger modified it -- which isn't propagated to EclipseLink). My question is that; is there a way to make this work? In the other thread I was advised to use the EntityManager#getRefrence() method, but obviously I can't use this in this situation. I'm sure that there should be some trick to make this work, because I'm pretty sure this is a very frequent use case.

--
Regards,
Bálint Kriván
_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top