aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGordon Yorke2014-03-14 10:53:32 -0400
committerGordon Yorke2014-03-14 10:53:32 -0400
commitb2b55f277dd1e1a2d2d2276413b453d59b28badc (patch)
tree50acd849df730ea8557e34e54243f03e38907227
parent263ac50f786e70794a974d3ca74c4f168835312e (diff)
downloadeclipselink.runtime-b2b55f277dd1e1a2d2d2276413b453d59b28badc.tar.gz
eclipselink.runtime-b2b55f277dd1e1a2d2d2276413b453d59b28badc.tar.xz
eclipselink.runtime-b2b55f277dd1e1a2d2d2276413b453d59b28badc.zip
Bug 430318 - When dynamic types is removed through DynamicHelper the JPQL query cache is not cleared
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicHelper.java2
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/helper/ConcurrentFixedCache.java4
2 files changed, 6 insertions, 0 deletions
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicHelper.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicHelper.java
index 7beade5f6d..ffb8abbad8 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicHelper.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/dynamic/DynamicHelper.java
@@ -123,6 +123,8 @@ public class DynamicHelper {
fqClassnameToDescriptor.remove(descriptor.getJavaClassName());
getSession().getProject().getOrderedDescriptors().remove(descriptor);
getSession().getProject().getDescriptors().remove(type.getJavaClass());
+ //bug 430318 - clear the parsed cache as queries in that cache could be using this descriptor
+ getSession().getProject().getJPQLParseCache().clear();
((AbstractSession)getSession()).getCommitManager().getCommitOrder().remove(type.getJavaClass());
}
}
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/helper/ConcurrentFixedCache.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/helper/ConcurrentFixedCache.java
index 9ec57651b9..4fc1612bb9 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/helper/ConcurrentFixedCache.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/helper/ConcurrentFixedCache.java
@@ -65,6 +65,10 @@ public class ConcurrentFixedCache implements Serializable {
public Object get(Object key) {
return this.cache.get(key);
}
+
+ public void clear(){
+ this.cache.clear();
+ }
/**
* Add the value to the cache.