Reputation: 97
My problem are that my entityManager
have my daabase in cache. This are a heavy problem because I´m doing a aplication prepared for many users and I cant show actual data.
public List<Tripulante> listxxx(String tip,
String uni, String est, boolean val) {
em.flush();
Query q = em.createQuery("select");
q.setParameter(dat1, uni);
q.setParameter(dat2, est);
q.setParameter(dat3, val);
return q.getResultList();
}
I tried with em.clear to.
Im very lost with that I dont know I touch in persistence.xml or weblogic in jndi
Upvotes: 0
Views: 700
Reputation: 97
I solve with that:
In persistence.xml i put that:
<property name="eclipselink.query-results-cache" value="false"/>
And in query that I doesnt wanna read in cache put that:
public List<Tripulante> listxxx(String tip,
String uni, String est, boolean val) {
Query q = em.createQuery("select");
q.setHint("javax.persistence.cache.storeMode", "REFRESH");
q.setParameter(dat1, uni);
q.setParameter(dat2, est);
q.setParameter(dat3, val);
return q.getResultList();
}
Upvotes: 2