I have a parent class and two child classes which inherit the parent class. An instance of the parent class has a list which contains one instance of each child classes. One of the child instances references the other one via a field.
The jdo file defines the parent and the childs using "new-table" strategy. The field where one child instance references the other is in the default fetch group. All class definitions in the JDO file are set to 'cacheable="false"' as defined here: http://www.datanucleus.org/products/accessplatform_3_1/jdo/metadata_xml.html
How to reproduce problem:
Retrieve a persistent parent instance and then iterate through each child instance (form the parent's list field). The returned class name for the child instance referenced by the other child instance is as of the parent class, not the child class, ie the wrong information is returned.
How to work around:
1) Set the parent class to 'cacheable="false"' but the child classes to 'cacheable="true"'
2) Remove the field used by one child instance to reference the other from the default fetch group.
3) Switch off L1 cache.
1) Does work around (1) above make sense conceptually. Ie would it make sense to set the parent to not-cacheable and the childs to cacheable?
2) If the parent is set to not-cacheable and the childs set to cacheable, is the object cached?
1) Kindly clarify on questions above and throw warning if (a) combination of JDO is not supported or (b) is illogical.
2) Fix and return correct class type. (preferred)