]
James Elford commented on DROOLS-1082:
--------------------------------------
I've started a pull request for this:
Querying for objects before any have been inserted prevents Class
Aware Object Store from working properly
----------------------------------------------------------------------------------------------------------
Key: DROOLS-1082
URL:
https://issues.jboss.org/browse/DROOLS-1082
Project: Drools
Issue Type: Bug
Affects Versions: 6.3.0.Final
Reporter: James Elford
Assignee: Mark Proctor
In the presence of a class heirarchy, the {{ClassAwareObjectStore}} doesn't properly
manage the relationships between {{SingleClassStores}} - specifically, it can become
permanently corrupt if the following order of events occurs:
* Insert object of type {{BaseClass}}
* Query for objects of type {{SubClass}}
** Note that it's important this query is fully evaluated (e.g. copy it into a list)
* Insert object of type {{SubClass}}
Subsequent queries for objects of type {{BaseClass}} will _not_ return objects of type
{{SubClass}}. If the intervening query for {{SubClass}} is left out, they would.
The problem's in {{ClassAwareObjectStore#getOrCreateConcreteClass}}, where it tries
to concretize an existing (non-concrete) store. It should go through the same
"linking" process that gets done in the {{existingStore == null}} case (and half
of which is done already in {{#getOrCreateClassStore}}).