Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Cache hits for non object queries
Cache hits for non object queries [message #515089] Wed, 17 February 2010 16:54 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: February 2010
Junior Member
Hello, is it possible to run queries that don't return an object against the cache?

For example a query like this that retrieves the lastnames from all Employees:
SELECT e.lastname FROM Employee e

Assume the table is cached with a full cache and a query was executed before so the cache should be fully populated. When using a ReportQuery i get an exception that report queries can not be used with CheckCacheOnly, when i use a ReadAllQuery the query returns objects instead of only the lastname values.
Re: Cache hits for non object queries [message #515440 is a reply to message #515089] Thu, 18 February 2010 18:57 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

No, ReportQuery (which is used for queries returning non-entities) will only hit the database. The reason is likely because the cache is an object cache, and report queries just were over looked as in-memory querying was implemented - it might have just been assumed the entire object would be wanted since it is available. A feature could be filed to get EclipseLink to extract the fields from objects after running the query in-memory, but It might be more efficient to have the application run a query for the entities and then just pull the data from the returned entities directly.

Best Regards,
Chris
Previous Topic:[SOLVED] Problem in custom classloader-environment: Object XYZ is not a known entity type
Next Topic:EclipseLink weaving for EMF models
Goto Forum:
  


Current Time: Fri Apr 26 21:46:10 GMT 2024

Powered by FUDForum. Page generated in 0.02846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top