Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-09-28 22:23:49 -0400
committerRyan D. Brooks2010-09-28 22:23:49 -0400
commit78e6c20da733d3f98d32c1758f5733e0e0bdbf85 (patch)
treec013fef6bc1454b4f1a735b7d9e124116cfeee18 /plugins
parent4010b3d96416e375c38aeff87ed5a04a90fd47fb (diff)
downloadorg.eclipse.osee-78e6c20da733d3f98d32c1758f5733e0e0bdbf85.tar.gz
org.eclipse.osee-78e6c20da733d3f98d32c1758f5733e0e0bdbf85.tar.xz
org.eclipse.osee-78e6c20da733d3f98d32c1758f5733e0e0bdbf85.zip
bug: Prevent sessionCache exception during dbinit when no tables exist
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeCache.java18
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java7
2 files changed, 24 insertions, 1 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 d7468cc490..158c56ae3c 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
@@ -45,11 +45,13 @@ public abstract class AbstractOseeCache<T extends AbstractOseeType> implements I
private final boolean uniqueName;
private boolean ensurePopulatedRanOnce;
private long lastLoaded;
+ private boolean ignoreEnsurePopulateException;
protected AbstractOseeCache(OseeCacheEnum cacheId, IOseeDataAccessor<T> dataAccessor, boolean uniqueName) {
this.lastLoaded = 0;
this.cacheId = cacheId;
this.ensurePopulatedRanOnce = false;
+ this.ignoreEnsurePopulateException = false;
this.dataAccessor = dataAccessor;
this.uniqueName = uniqueName;
}
@@ -67,6 +69,14 @@ public abstract class AbstractOseeCache<T extends AbstractOseeType> implements I
}
+ public void setIgnoreEnsurePopulateException(boolean isIgnored) {
+ this.ignoreEnsurePopulateException = isIgnored;
+ }
+
+ public boolean isEnsurePopulateExceptionIgnored() {
+ return ignoreEnsurePopulateException;
+ }
+
@Override
public OseeCacheEnum getCacheId() {
return cacheId;
@@ -254,7 +264,13 @@ public abstract class AbstractOseeCache<T extends AbstractOseeType> implements I
public synchronized void ensurePopulated() throws OseeCoreException {
if (!ensurePopulatedRanOnce) {
ensurePopulatedRanOnce = true;
- reloadCache();
+ try {
+ reloadCache();
+ } catch (OseeCoreException ex) {
+ if (!isEnsurePopulateExceptionIgnored()) {
+ throw ex;
+ }
+ }
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
index 2751c6c10e..47c7df3378 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
@@ -18,6 +18,7 @@ import java.util.Set;
import org.eclipse.osee.framework.core.data.IOseeUserInfo;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.data.OseeSessionGrant;
+import org.eclipse.osee.framework.core.data.SystemUser;
import org.eclipse.osee.framework.core.enums.StorageState;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.server.IAuthenticationManager;
@@ -62,6 +63,12 @@ public final class SessionManagerImpl implements ISessionManager {
sessionFactory.create(GUID.create(), oseeUserInfo.getUserID(), creationDate, managedByServerId,
credential.getVersion(), credential.getClientMachineName(), credential.getClientAddress(),
credential.getPort(), creationDate, StorageState.CREATED.name().toLowerCase());
+
+ if (credential.getUserName().equals(SystemUser.BootStrap.getName())) {
+ sessionCache.setIgnoreEnsurePopulateException(true);
+ } else {
+ sessionCache.setIgnoreEnsurePopulateException(false);
+ }
sessionCache.cache(session);
sessionGrant = sessionFactory.createSessionGrant(session, oseeUserInfo);
}

Back to the top