Author: shawkins
Date: 2011-05-10 10:54:22 -0400 (Tue, 10 May 2011)
New Revision: 3159
Modified:
branches/7.4.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
Log:
TEIID-1580 refining the fix for CME during dynamic vdb load, only need to not set status
if an asynch load is happening
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-05-10
14:44:57 UTC (rev 3158)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-05-10
14:54:22 UTC (rev 3159)
@@ -111,11 +111,11 @@
repo.addTranslatorMetadata(data.getName(), data);
}
createConnectorManagers(cmr, repo, deployment);
-
+ boolean asynchLoad = false;
// if store is null and vdb dynamic vdb then try to get the metadata
if (store == null && deployment.isDynamic()) {
store = new MetadataStoreGroup();
- buildDynamicMetadataStore((VFSDeploymentUnit)unit, deployment, store, cmr);
+ asynchLoad = buildDynamicMetadataStore((VFSDeploymentUnit)unit, deployment, store,
cmr);
}
// allow empty vdbs for enabling the preview functionality
@@ -159,7 +159,8 @@
// Check if the VDB is fully configured.
if (!valid) {
deployment.setStatus(VDB.Status.INACTIVE);
- } else if (!deployment.isDynamic()) {
+ } else if (!asynchLoad) {
+ //if asynch this will be set by the loading thread
this.vdbRepository.finishDeployment(deployment.getName(), deployment.getVersion());
deployment.setStatus(VDB.Status.ACTIVE);
}
@@ -282,8 +283,8 @@
}
}
- private void buildDynamicMetadataStore(final VFSDeploymentUnit unit, final
VDBMetaData vdb, final MetadataStoreGroup vdbStore, final ConnectorManagerRepository cmr)
throws DeploymentException {
-
+ private boolean buildDynamicMetadataStore(final VFSDeploymentUnit unit, final
VDBMetaData vdb, final MetadataStoreGroup vdbStore, final ConnectorManagerRepository cmr)
throws DeploymentException {
+ boolean asynch = false;
// make sure we are configured correctly first
for (final ModelMetaData model:vdb.getModelMetaDatas().values()) {
if (model.getSourceNames().isEmpty()) {
@@ -302,6 +303,7 @@
}
if (!loaded) {
+ asynch = true;
threadPool.run(new Runnable() {
@Override
public void run() {
@@ -317,6 +319,7 @@
});
}
}
+ return asynch;
}
/**
Show replies by date