Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Joy2013-08-07 19:43:52 +0000
committerRoberto E. Escobar2013-08-19 22:20:48 +0000
commit701e79dd1e586d5c1a1384074477a1fceb110cf1 (patch)
tree129800e06e9fe91f566c1158dff807bd48327569 /plugins/org.eclipse.osee.framework.core.model
parentafd7e7d0715df91c2fc8fdf57443f80d25e5b14c (diff)
downloadorg.eclipse.osee-701e79dd1e586d5c1a1384074477a1fceb110cf1.tar.gz
org.eclipse.osee-701e79dd1e586d5c1a1384074477a1fceb110cf1.tar.xz
org.eclipse.osee-701e79dd1e586d5c1a1384074477a1fceb110cf1.zip
bug: Synchronized cache populate method
In order to fix server side deadlock during type cache loading a configurable synchronized block was added to the cache populate method. This is no longer neeeded. Always synchronize populate method to avoid data integrity issues. See ATS - SF2V6 for more information. Change-Id: I6b4f6a535c57ec0557eebf1214c0db215aedc35f Signed-off-by: Mark Joy <mark.joy@boeing.com>
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.model')
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeCache.java25
1 files changed, 2 insertions, 23 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeCache.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeCache.java
index 3815b307232..8fa78cfa4b5 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeCache.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeCache.java
@@ -48,7 +48,6 @@ public abstract class AbstractOseeCache<K, T extends AbstractOseeType<K>> implem
private final AtomicBoolean wasLoaded;
private long lastLoaded;
private boolean ignoreEnsurePopulateException;
- private boolean isEnsurePopulateSynchronized;
protected AbstractOseeCache(OseeCacheEnum cacheId, IOseeDataAccessor<K, T> dataAccessor, boolean uniqueName) {
this.lastLoaded = 0;
@@ -57,16 +56,6 @@ public abstract class AbstractOseeCache<K, T extends AbstractOseeType<K>> implem
this.ignoreEnsurePopulateException = false;
this.dataAccessor = dataAccessor;
this.uniqueName = uniqueName;
- this.isEnsurePopulateSynchronized = true;
- }
-
- // Temporary fix to avoid deadlock on server types cache loading
- public void setSynchronizedEnsurePopulate(boolean isSynchronized) {
- this.isEnsurePopulateSynchronized = isSynchronized;
- }
-
- public boolean isSynchronizedEnsurePopulate() {
- return isEnsurePopulateSynchronized;
}
public void invalidate() {
@@ -274,7 +263,8 @@ public abstract class AbstractOseeCache<K, T extends AbstractOseeType<K>> implem
storeItems(getAllDirty());
}
- private void populate() throws OseeCoreException {
+ @Override
+ public synchronized void ensurePopulated() throws OseeCoreException {
if (wasLoaded.compareAndSet(false, true)) {
try {
reloadCache();
@@ -286,17 +276,6 @@ public abstract class AbstractOseeCache<K, T extends AbstractOseeType<K>> implem
}
}
- @Override
- public void ensurePopulated() throws OseeCoreException {
- if (isSynchronizedEnsurePopulate()) {
- synchronized (this) {
- populate();
- }
- } else {
- populate();
- }
- }
-
public void storeByGuid(Collection<K> guids) throws OseeCoreException {
ensurePopulated();
Conditions.checkNotNull(guids, "guids to store");

Back to the top