openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pinaki Poddar (JIRA)" <>
Subject [jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache
Date Wed, 28 Feb 2007 21:34:50 GMT


Pinaki Poddar commented on OPENJPA-35:

I am not seeing this particular error anymore -- but I am seeing something else that does
not appear right. 

a) When datacache is active, even after an instance is deleted via query, the entitymanager
is committed and cleared, EntityManager find() finds the instance -- not from its L1 cache
but from its L2 cache.

If this is a known limitation -- it should be documented (could not find it in OpenJPA User's

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

c) delete directly i.e. em.remove() does the 'right' thing i.e. subsequent em.find() returns

d) Setting "openjpa.BrokerImpl" to "EvictFromDataCache=true" did not change the behavior (nor
was expected)

The observations are based on the attached TestCase

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>                 Key: OPENJPA-35
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
> 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:
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(
> 	at org.apache.openjpa.kernel.QueryImpl.delete(
> 	at org.apache.openjpa.kernel.QueryImpl.execute(
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(
> 	at control.Test.clear(
> 	at
> 	at control.Test.main(
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(
> 	at org.apache.openjpa.kernel.QueryImpl.execute(
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(
> 	... 11 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message