Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] ReadAll queries ignores cache

Hi Tom,

Thanks very much for the answer. That makes sense. I've achieved the desired behaviour by using CheckCacheOnly since I know in this specific query I will always have synchronized data.

Thanks,
Mohamed

On Thu, May 6, 2010 at 1:27 PM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
HI Mohamed,

 ReadAll queries must go to the database to get the primary keys - to ensure that all the elements in the database are returned since there is no guarantee all the elements can be found in the cache.

 For objects that exist in the cache, the query will return those objects.

-Tom

Mohamed ElShami wrote:
Hi all,

I have a find all query like this:

@NamedQuery(name = "Department.findAll", query = "SELECT d FROM Department
d",
hints = {
  @QueryHint(name = "eclipselink.cache-usage", value =
"CheckCacheThenDatabase"),
  @QueryHint(name = "eclipselink.query-type", value = "ReadAll")
})

The query still goes to the database everytime. Does Eclipselink ignores
cache for read all?

Thanks in advance,
Mohamed



------------------------------------------------------------------------

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



--
Best Regards,
  Mohamed Elshami

Back to the top