1 Reply Latest reply on Sep 22, 2006 8:46 AM by Galo

    Cached NamedQuery, how to disable?

    Galo Newbie

      I have a couple of NamedQueries on an Entity EJB the retrieve a set of objects.

      I my Stateless EJB saves updates and saves the entity (merge, flush, data IS in updated in the database), and later the named query is executed again, the same entity is retrieved WITHOUT the changes. If i execute a refresh() on every single object, they are loaded correctly so I think some sort of caching is going on in the named query, but I cannot disable it.

      javax.persistence.NamedQuery doesn't support "cacheable=false", and I've tried using org.hibernate.NamedQuery which does but still doesn't work.

      any help?

      thanks

        • 1. Re: Cached NamedQuery, how to disable?
          Galo Newbie

          Christ sorry about that paragraph.. it can barely be understood.. just to make it readable, there it goes again:

          I have a couple of NamedQueries on an Entity EJB the retrieve a set of objects.

          My Stateless EJB updates and saves the entity (merge, flush, data IS updated in the database), and later the named query is executed again but the same entity is retrieved WITHOUT the changes. If i execute a refresh() on every single object, they are loaded correctly so I think some sort of caching is going on in the named query, but I cannot disable it.

          javax.persistence.NamedQuery doesn't support "cacheable=false", and I've tried using org.hibernate.NamedQuery which does but still doesn't work.