HI Oleg, Can you post the specific exception or error condition you are referring to? OpenJPA utilizes several caches. It sounds like you might be referring to the QuerySQLCache not being able to cache the generated SQL. This is different from the QueryCache which caches the results of various Queries. Just trying to clarify which cache you are experiencing problems with.
Thanks, Kevin On Thu, May 19, 2011 at 7:28 AM, LYALIKOV, OLEG (OLEG)** CTR ** < [email protected]> wrote: > Hello, > I'm using openjpa-2.0.0 and have some base class > > @Entity > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) > public abstract class Base { ... } > > and also some inheritors > > @Entity > @Inheritance(strategy = InheritanceType.JOINED) > public class A extends Base { ... } > > @Entity > @Inheritance(strategy = InheritanceType.JOINED) > public class B extends Base { ... } > > Base class has some fields which are used as in A as in B class but these > fields are in separate tables (for A and B class) with no common table. > > The problem is: if I have cached query involving A class and then I > create/update/delete object of B class then I get invalidated query for > class A because both A and B class have common persistent class Base and > openjpa decides that changing object of class B affects cached queries > involving class A which is not true (I have two separate tables - one for A > and one for B class). > > This is significant problem for me because I have lots of inheritors of > Base class and all these inheritors have own table and don't have some > common table and these query cache invalidates slow system. > > Is there any workaround? I tried extending QueryCache implementations but > with no success (for example removing Base class from access path of > QueryKey object didn't help because of some other realization details of > QueryKey object which I can't change) >
