[ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479277 ]
Patrick Linskey commented on OPENJPA-35: ---------------------------------------- > b) When openjpa.datacache=false, the application can still obtain a > non-null reference to StoreCache, however its delegate is null. > What should OpenJPAEntityManagerFactory.getStoreCache() return > when openjpa.datacache=false ? I think that this is fine behavior. You generally shouldn't need to get the StoreCache's delegate. The current behavior is nice because user code doesn't need to check whether or not a cache is active; instead, user code can just perform cache operations. Sure, they're no-ops when the cache isn't on, but that's fine. > In-memory Delete operation fails with active DataCache > ------------------------------------------------------ > > Key: OPENJPA-35 > URL: https://issues.apache.org/jira/browse/OPENJPA-35 > Project: OpenJPA > Issue Type: Bug > Components: datacache, query > Affects Versions: 0.9.0, 0.9.6 > Environment: Only happens when DataCache is active > <property name="openjpa.DataCache" > value="true"/> > <property name="openjpa.RemoteCommitProvider" > value="sjvm"/> > Reporter: Pinaki Poddar > Priority: Critical > Fix For: 0.9.7 > > Attachments: openjpa-35.test.zip, openjpa-35.trace.txt > > > Delete through query such as > Query query = em.createQuery("DELETE FROM Node n"); > query.executeUpdate(); > fails with following exception (only when DataCache is active) > Exception in thread "main" <4|false|0.0.0> > org.apache.openjpa.persistence.ArgumentException: > org.apache.openjpa.datacache.QueryCacheStoreQuery > at > org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029) > at > org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665) > at > org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348) > at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768) > at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831) > at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827) > at > org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544) > at > org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299) > at control.Test.clear(Test.java:87) > at control.Test.run(Test.java:37) > at control.Test.main(Test.java:178) > Caused by: java.lang.ClassCastException: > org.apache.openjpa.datacache.QueryCacheStoreQuery > at > org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949) > at > org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018) > ... 11 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.