openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Using QueryCache, still seeing queries sent to the DB
Date Tue, 03 Sep 2013 20:22:05 GMT
>Is there any reason that should affect whether or not the query misses the
cache?
The only thing that comes to mind, is do you have .equals() and .hashCode()
implemented? Then again, I don't know if that is important or not.

For giggles, have you tried to change your query to be something like 'where
m._image.id = :image.id'?


On Tue, Sep 3, 2013 at 2:56 PM, tlianza <nabble@lianza.org> wrote:

> tlianza wrote
> > SELECT m from ImageRepModel m where m._image = :image AND m._type = :type
>
> So, we've done quite a bit more troubleshooting here and found that the
> scenarios in which this query is *not* being cached is then the :image
> param
> that's passed in is a *detached* ImageModel object.  Is there any reason
> that should affect whether or not the query misses the cache?
>
> Keep in mind the relationship here is such that this query only needs the
> ImageModel's id, which is both available in the detatched object and is
> marked as that object's primary key.
>
> Thanks,
> Tom
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Using-QueryCache-still-seeing-queries-sent-to-the-DB-tp7584807p7584837.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>



-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message