Skip to content

Commit

Permalink
TEIID-5466 correcting session cleanup in reuse scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Sep 6, 2018
1 parent 74954ba commit 2629baf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Expand Up @@ -80,6 +80,7 @@ public CompositeVDB(VDBMetaData vdb, MetadataStore metadataStore,
this.originalVDB = vdb;
this.vdbKey = new VDBKey(originalVDB.getName(), originalVDB.getVersion());
buildCompositeState(vdbRepository);
this.mergedVDB.addAttchment(VDBKey.class, this.vdbKey);
}

private static TransformationMetadata buildTransformationMetaData(VDBMetaData vdb,
Expand Down
7 changes: 3 additions & 4 deletions runtime/src/main/java/org/teiid/deployers/VDBRepository.java
Expand Up @@ -135,7 +135,6 @@ public void addVDB(VDBMetaData vdb, MetadataStore metadataStore,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40035, vdb.getName(), vdb.getVersion()));
}
vdb.setVersion(vdbKey.getVersion()); //canonicalize the version
vdb.addAttchment(VDBKey.class, vdbKey); //save the key for comparisons
vdb.setStatus(Status.LOADING);
this.vdbRepo.put(vdbKey, cvdb);
this.pendingDeployments.remove(vdbKey);
Expand Down Expand Up @@ -286,12 +285,12 @@ public VDBMetaData removeVDB(String vdbName, Object vdbVersion) {
}

private VDBMetaData removeVDB(VDBKey key) {
notifyBeforeRemove(key.getName(), key.getVersion(), this.vdbRepo.get(key));
CompositeVDB removed = this.vdbRepo.remove(key);
this.pendingDeployments.remove(key);
CompositeVDB removed = this.vdbRepo.remove(key);
if (removed == null) {
return null;
return null;
}
notifyBeforeRemove(key.getName(), key.getVersion(), removed);
removed.getVDB().setStatus(Status.REMOVED);
// stop object replication
if (this.objectReplictor != null) {
Expand Down
Expand Up @@ -44,11 +44,13 @@ public class IntegrationTestVDBReuse extends AbstractMMQueryTestCase {
@Before
public void setup() throws Exception {
admin = AdminFactory.getInstance().createAdmin("localhost", 9990, "admin", "admin".toCharArray());
assertEquals(0, admin.getSessions().size());
}

@After
public void teardown() throws AdminException {
AdminUtil.cleanUp(admin);
assertEquals(0, admin.getSessions().size());
admin.close();
}

Expand Down

0 comments on commit 2629baf

Please sign in to comment.