Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Christian Ernst
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

ghost twin objects returned by Query when using complete-table mapping.

Created: 09/Jun/11 09:30 AM   Updated: 11/Jun/11 03:21 PM   Resolved: 11/Jun/11 03:21 PM
Component/s: ORM
Affects Version/s: 3.0.0.m4
Fix Version/s: None

File Attachments: 1. Zip Archive (14 kB)

Datastore: MySQL

 Description  « Hide
Ghost twin objects returned by Query when using complete-table.
The twin is a hollow object of the subclass with the same primary oid.
( class part of the datanucleus oid is different)
For each class in the inheritance tree such a ghost twin object gets returned.
public class A {
private int a;

public void setA(int a) {
this.a = a;
public class B extends A{

Properties properties = new Properties();
try {
properties.load(new FileInputStream(""));
} catch (FileNotFoundException e) {
} catch (IOException e) {

properties.setProperty("datanucleus.autoCreateSchema", "true");

PersistenceManagerFactory pmf = JDOHelper
PersistenceManager pm = pmf.getPersistenceManager();

JDOPersistenceManagerFactory dpmf = (JDOPersistenceManagerFactory) pmf;
NucleusContext ctx = dpmf.getNucleusContext();
Set classNames = new HashSet();
try {
((SchemaAwareStoreManager) ctx.getStoreManager()).createSchema(
classNames, properties);
} catch (Exception e) {

Transaction txn = pm.currentTransaction();

A a = new A();
B b = new B();


pmf = JDOHelper
pm = pmf.getPersistenceManager();

txn = pm.currentTransaction();

Query qry = pm.newQuery(A.class,"a == param");
qry.declareParameters("int param");
Collection<A> res = (Collection<A>) qry.execute(new Integer(42));

for (A aa : res) {


Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 10/Jun/11 10:51 AM
Presume you mean 3.0-m4 since unreleased software doesn't exist yet.

Christian Ernst added a comment - 10/Jun/11 10:55 AM - edited
Correctly is actually 3.0.0.m5 snapshot.
I was testing if the fix for (NUCRDBMS-527) solves my problems to get Datanucleus to work with the latest Poleposition benchmark (

Andy Jefferson added a comment - 10/Jun/11 11:00 AM
As in JIRA front page, we do not accept issues marked against unreleased software since its a daft concept. Bug in and fixed in are used for release notes, so no point in issues showing up as "bug in" version X and "fixed in" version X.

If you have an issue with the fix to NUCRDBMS-527 then raise it against that and I'll reopen it.

Christian Ernst added a comment - 10/Jun/11 11:10 AM
I wanted only to help you by testing the unreleased fix (NUCRDBMS-527) already with my application before 3.0.0.m5 is released and stumbled over a new problem.
So how shall i file such kind of bugs ?
Always as part of the original bug ? Or do i have to wait for the official release ?

Andy Jefferson added a comment - 10/Jun/11 01:05 PM
As already said, the original issue is the place to put anything during a development cycle. Thx
PS, please look at which defines an accepted testcase for JDO and JPA. I simply don't have time to accept anything else and have to massage it into that form

Andy Jefferson added a comment - 11/Jun/11 03:21 PM