Hibernate Query setCacheable(false) vs setCacheMode(CacheMode.IGNORE)

30 Views Asked by At

I was trying to disable a specific query from being saved to Hibernate queryPlanCache and came across 2 methods in Query that seem to be there for this:

setCacheable(false) and setCacheMode(CacheMode.IGNORE)

But using both of these in isolation and combination did not yield the desired result.

I also tried setCacheMode(CacheMode.IGNORE) on Session object but that too failed.

Is there a way to achieve this?

Note: I do not want to disable the cache for all queries, but only for a specific one.

0

There are 0 best solutions below