Community
Participate
Working Groups
Build Identifier: I20110613-1736 DataElement.isSpirit() may return true for newly created DataElement objects if they were retrieved from the cache of recycled elements. Reproducible: Always Steps to Reproduce: In our code we call one of the DataStore.createObject() methods. It will call DataStore.createElement() which will try to retrieve an element from a cache of recycled elements. This cache may contain spirits - elements that were handled by DataElementRemover. The problem is that createObject() will never change the spirit state of elements retrieved from the cache of recycled elements. This means that your newly created DataElement instance will return true for isSpirit() although that is obviously incorrect.
Created attachment 208566 [details] patch to clear spirit bit when getting a recycled DataElement
Petar, does this patch solve the problem?
I've created bu 367097 to backport the fix to the 3.2.x version.
(In reply to comment #2) > Petar, does this patch solve the problem? Looks like it should solve it. We've implemented a similar workaround in our code for the time being - call setSpirit(false) after every call to createObject(). I'll be able to retest once the patch is released as part of an official release and we upgrade our target platform to it.
Okay, I've committed the patch to the HEAD stream.