Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-11-16 15:24:02 -0500
committerRyan D. Brooks2011-11-16 15:24:02 -0500
commitfd16031f3e0115c4322cb6cfcdef1f574a2fd2d6 (patch)
tree49aea37c92c2e149b677687175038927b0b4cb4f
parent640635510be6cfb43e29ee1ca15cc5c10c3835fb (diff)
downloadorg.eclipse.osee-fd16031f3e0115c4322cb6cfcdef1f574a2fd2d6.tar.gz
org.eclipse.osee-fd16031f3e0115c4322cb6cfcdef1f574a2fd2d6.tar.xz
org.eclipse.osee-fd16031f3e0115c4322cb6cfcdef1f574a2fd2d6.zip
bug[ats_BHVGE]: Server command reload_cache fails
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java7
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java10
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java20
3 files changed, 22 insertions, 15 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java
index e7065336f3..d1e186024c 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java
@@ -41,7 +41,7 @@ public class ArtifactTypeDataAccessor<T extends AbstractOseeType<Long>> implemen
private static final String LOAD_OSEE_TYPE_DEF_URIS =
"select attr.uri from osee_txs txs1, osee_artifact art, osee_attribute attr, osee_txs txs2 where txs1.branch_id = ? and txs1.tx_current = ? and txs1.gamma_id = art.gamma_id and txs2.branch_id = ? and txs2.tx_current = ? and txs2.gamma_id = attr.gamma_id and art.art_type_id = ? and art.art_id = attr.art_id and attr.attr_type_id = ?";
- private static volatile boolean wasLoaded;
+ private static volatile boolean loadInProgress;
private final ModelingServiceProvider modelService;
private final IOseeDatabaseService databaseService;
@@ -61,8 +61,8 @@ public class ArtifactTypeDataAccessor<T extends AbstractOseeType<Long>> implemen
@Override
public synchronized void load(IOseeCache<Long, T> cache) throws OseeCoreException {
- if (!wasLoaded) {
- wasLoaded = true;
+ if (!loadInProgress) {
+ loadInProgress = true;
Collection<String> uriPaths = findOseeTypeData();
if (!uriPaths.isEmpty()) {
List<IResource> resources = getTypeData(uriPaths);
@@ -72,6 +72,7 @@ public class ArtifactTypeDataAccessor<T extends AbstractOseeType<Long>> implemen
OseeImportModelResponse response = new OseeImportModelResponse();
modelService.getIOseeModelingService().importOseeTypes(new NullProgressMonitor(), true, request, response);
}
+ loadInProgress = false;
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java
index 0544c2e9d4..60f5e0bac7 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java
@@ -108,11 +108,13 @@ public class OseeCachingService implements IOseeCachingService {
public synchronized void reloadAll() throws OseeCoreException {
getBranchCache().reloadCache();
getTransactionCache().reloadCache();
- getEnumTypeCache().reloadCache();
- getAttributeTypeCache().reloadCache();
- getArtifactTypeCache().reloadCache();
- getRelationTypeCache().reloadCache();
getIdentityService().clear();
+ getArtifactTypeCache().reloadCache();
+
+ //reloading the artifactTypeCache will reload these:
+ // getEnumTypeCache().reloadCache();
+ // getAttributeTypeCache().reloadCache();
+ // getRelationTypeCache().reloadCache();
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
index a30eec767f..00f06e31ed 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
@@ -54,6 +54,11 @@ public class ServerAdminCommandProvider implements CommandProvider {
private final ISchedulingRule cacheMutex = new MutexSchedulingRule();
private final ISchedulingRule shutdownMutex = new MutexSchedulingRule();
+ private final OseeCacheEnum[] reloadableCaches = {
+ OseeCacheEnum.ARTIFACT_TYPE_CACHE,
+ OseeCacheEnum.BRANCH_CACHE,
+ OseeCacheEnum.TRANSACTION_CACHE};
+
public Job _server_status(CommandInterpreter ci) {
OperationLogger logger = new CommandInterpreterLogger(ci);
return Operations.executeAsJob(new ServerStats(logger), false);
@@ -84,11 +89,7 @@ public class ServerAdminCommandProvider implements CommandProvider {
}
public Job _reload_cache(CommandInterpreter ci) {
- return updateCaches(ci, false);
- }
-
- public Job _clear_cache(CommandInterpreter ci) {
- return updateCaches(ci, false);
+ return updateCaches(ci, true);
}
private Job updateCaches(CommandInterpreter ci, boolean reload) {
@@ -98,6 +99,10 @@ public class ServerAdminCommandProvider implements CommandProvider {
cacheIds.add(OseeCacheEnum.valueOf(arg));
}
+ if (cacheIds.isEmpty()) {
+ cacheIds.addAll(Arrays.asList(reloadableCaches));
+ }
+
OperationLogger logger = new CommandInterpreterLogger(ci);
return Operations.executeAsJob(new UpdateCachesOperation(logger, cacheIds, reload), false, cacheMutex);
}
@@ -253,9 +258,8 @@ public class ServerAdminCommandProvider implements CommandProvider {
sb.append(" find_invalid_utf8 - finds invalid UTF8 chars in table osee_attribute\n");
sb.append(" consolidate_relations - consolidate rows of relations\n");
sb.append(String.format(" reload_cache %s? - reloads server caches\n",
- Arrays.deepToString(OseeCacheEnum.values()).replaceAll(",", " | ")));
- sb.append(String.format(" clear_cache %s? - decaches all objects from the specified caches\n",
- Arrays.deepToString(OseeCacheEnum.values()).replaceAll(",", " |")));
+ Arrays.deepToString(reloadableCaches).replaceAll(",", " | ")));
return sb.toString();
}
+
}

Back to the top