Skip to content

Commit

Permalink
TEIID-3390 restricting the life of copy lobs to that of the statement
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Mar 23, 2015
1 parent d47cf9f commit 7255653
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Expand Up @@ -1046,6 +1046,9 @@ void addMemoryEntry(CacheEntry ce, boolean initial) {

void removeCacheGroup(Long id, Boolean prefersMemory) {
cleanSoftReferences();
if (cache == null) {
return; //this could be called after shutdown
}
Collection<Long> vals = cache.removeCacheGroup(id);
long overhead = vals.size() * BATCH_OVERHEAD;
overheadBytes.addAndGet(-overhead);
Expand Down
Expand Up @@ -220,7 +220,10 @@ public synchronized AtomicResultsMessage more() throws TranslatorException {

public synchronized void close() {
lobBuffer = null;
lobStore = null; //can still be referenced by lobs and will be cleaned-up by reference
if (lobStore != null) {
lobStore.remove();
lobStore = null;
}
if (!manager.removeState(this.id)) {
return; //already closed
}
Expand Down
Expand Up @@ -1242,13 +1242,13 @@ public void release() {

private void done() {
doneProducingBatches();
addToCache();
//TODO: we could perform more tracking to know what source lobs are in use
if (this.resultsBuffer.getLobCount() == 0) {
for (DataTierTupleSource connectorRequest : getConnectorRequests()) {
connectorRequest.fullyCloseSource();
}
}
addToCache();
}

private void doneProducingBatches() {
Expand Down

0 comments on commit 7255653

Please sign in to comment.