Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Caching read-all queries

I'm using 1.2 and have a couple cache related questions.

Do read-all queries (ones using getResultList()) always hit the database?

As I understand the docs, the "CheckCacheThenDatabase" hit only
applies to read-object queries (ones using getSingleResult()).  In my
app, I have a ton of queries that are candidates for caching, but they
all use getResultList(). I've set an @Cache(expiry=60000) annotation
on those entities and when I execute them, I keep seeing the queries
printed in the logs.

To me, this isn't the greatest behaviour since I'm executing the exact
same query with the exact same parameters.  Shouldn't EclipseLink have
a way of optimizing this?

Thanks,
Zarar


Back to the top