0

Hello guys I have pretty strange problem that I cannot resolve my code looks like this:

@Transactional
public List<ProductObject> readproductObjectes() {

    TypedQuery<ProductObject> query = em.createQuery("SELECT productObject FROM pl.allegroapp.classes.allegro.ProductObjectImpl productObject ORDER BY productObject.yourNewStyleId DESC", ProductObject.class);
    List<ProductObject> ProductObjectList =  query.getResultList();

    return query.getResultList();
}

After I edit some entities and reload them using this - there are no changes, I see changes on database etc but not in application. I tried many ways to "refresh" the data. I added this:

em.getEntityManagerFactory().getCache().evictAll();
em.setProperty("javax.persistence.cache.retrieveMode", CacheRetrieveMode.BYPASS);
query.setHint("javax.persistence.cache.retrieveMode", CacheRetrieveMode.BYPASS);

Nothing of this worked for me.

user3353393
  • 139
  • 3
  • 12
  • Could you enable trace logging level for everything (or at least Spring and Hibernate) and retry the request. Then post relevant parts from the log here. – Dragan Bozanovic Jun 10 '15 at 13:46
  • And when you completely reboot the application you do see the changes then? Do you have a 2nd level cache setup in Hibernate? – Gimby Jun 10 '15 at 15:52

0 Answers0