Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipselink caching behaviour

By default only the find() operation will get a cache hit, queries will
always go to the database.

You can allow a query to get a cache hit using the
"eclipselink.query-type"="ReadObject" query hint.

elygre wrote:
> I'm working on understanding the eclipselink cache, and I still have quite
> a
> way to go J
> I have an entity with a single column primary key (String). If i use
> "em.find(key)", this is cached, so that repeated lookups don't go to the
> database. If i create a Query referring the  key ("select o from IkbPage o
> where key = ?1"), and then use query.getSingleResult(), it is not cached,
> and I see multiple identical queries.
> Is there a configuration option I need to switch on?
> Or is this just not possible?
> Eirik

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top