<p>I have no idea why any of this is there of how it work. It seems to me that the DB layer was meant to be an easy-to-use, efficient object storage, but it is nothing like that [1].</p>

<p>The problem this time is that Pipeline#clear() does not clear the DBWorkflow's "index" thing, the <code>objects</code> dictionary (because <code>db_delete_module()</code> doesn't), so objects stay in there. I lost most of today tracking that down while working the interpreter...</p>

<hr>

<p>[1]: The piece of code for deleting a module loops until it finds it!</p>

<div class="highlight highlight-source-python"><pre>    <span class="pl-k">def</span> <span class="pl-en">db_delete_module</span>(<span class="pl-smi">self</span>, <span class="pl-smi">module</span>):
        <span class="pl-v">self</span>.is_dirty <span class="pl-k">=</span> <span class="pl-c1">True</span>
        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">xrange</span>(<span class="pl-c1">len</span>(<span class="pl-v">self</span>._db_modules)):
            <span class="pl-k">if</span> <span class="pl-v">self</span>._db_modules[i].db_id <span class="pl-k">==</span> module.db_id:
                ...</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/VisTrails/VisTrails/issues/1137">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AEd06YpPmHdEmhT53mw2oMP2-GNzCEi0ks5o-pC8gaJpZM4GUz8K.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/VisTrails/VisTrails/issues/1137"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>