openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: CriteriaQuery with shared-cache-mode Enabled Not Working
Date Sat, 23 Apr 2011 16:42:33 GMT
  The way I will approach to narrow down the problem is as follows:
   1. Let C be a CriteriaQuery and J be the equivalent JPQL string.
       Do C and J when executed independently in separate persistence
context produce exactly the same result irrespective of shared data cache
       If they do, then the problem is not specific to CriteriaQuery per se
and lies somewhere else.
       If they do not, then there is a bug in CriteriaQuery especially when
used in conjunction with data cache.

  2.  Is the query result influenced by existing data in the persistence
       To evaluate, use separate ems in your example. em1 to populate the
'expect' list and em2 to populate the 'result' list. The 'result' list can
be populated from both C and J and examine three-way (i.e. the list you
create via PortfoliEntitymanager in first section, result of C's execution
and that of J's execution) to see there is a difference.

  3. Is shared data cache causing the problem?
      Switch off the data cache entirely and test.

  4. Another angle is Prepared Query Cache -- a mechanics used to cache a
query string when the same query is executed multiple times. It is known to
cause problems. To keep it out of the equation, switch it off by

 I can not determine the core assertion i.e. the 'expect' list and 'result'
list be equal because how the 'expect' list is formed is not visible to me.
But hope that the above steps will help you to narrow down the issue.

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message