Issue Details (XML | Word | Printable)

Key: JDO-261
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michelle Caisse
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

TestHashSetCollections, TestSetCollections : schema incorrect

Created: 13/Dec/05 05:32 PM   Updated: 17/Dec/05 01:22 PM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 17/Dec/05 01:22 PM


 Description  « Hide
HashSetCollections/SetCollections are mapped incorrectly. They should have a primary-key specified in the metadata to tell the JDO implementation which columns to use for PK. Without this the JDO implementation can do whatever it likes wrt defining a PK. This includes adding its own adapter columns.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #357130 Fri Dec 16 05:59:11 UTC 2005 mcaisse JDO-261
Files Changed
MODIFY /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections-derby.orm
MODIFY /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections-derby.orm

Michelle Caisse added a comment - 16/Dec/05 03:03 PM
I fixed the orm metadata for datastore identity with revision 357130, but the error persists. The error also occurs with application identity, which does not require the primary-key specification in the mapping.

test(org.apache.jdo.tck.models.fieldtypes.TestHashSetCollections)javax.jdo.JDODataStoreException: Add request failed : INSERT INTO applicationidentity0.HASHSET_OF_OBJECT2 (IDENTIFIER,COLLVAL,ADPT_PK_IDX) VALUES (?,?,?)

FailedObject:[Ljava.lang.Object;@102720c

at org.jpox.store.rdbms.scostore.NormalSetStore.addAll(NormalSetStore.java:657)

at org.jpox.store.mapping.CollectionMapping.postUpdate(CollectionMapping.java:282)

at org.jpox.store.rdbms.request.UpdateRequest.execute(UpdateRequest.java:282)

at org.jpox.store.rdbms.table.ClassTable.update(ClassTable.java:2118)

at org.jpox.store.StoreManager.update(StoreManager.java:780)

at org.jpox.state.StateManagerImpl.flush(StateManagerImpl.java:4401)

at org.jpox.state.StateManagerImpl.runReachability(StateManagerImpl.java:3154)

at org.jpox.AbstractPersistenceManager.preCommit(AbstractPersistenceManager.java:3145)

at org.jpox.NonmanagedTransaction.commit(NonmanagedTransaction.java:435)

at org.apache.jdo.tck.models.fieldtypes.TestHashSetCollections.runTest(TestHashSetCollections.java:96)

at org.apache.jdo.tck.models.fieldtypes.TestHashSetCollections.test(TestHashSetCollections.java:75)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204)

at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)

at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)


Michelle Caisse made changes - 16/Dec/05 03:03 PM
Field Original Value New Value
Assignee Michelle Caisse [ mcaisse ] Andy Jefferson [ andy ]
Andy Jefferson added a comment - 16/Dec/05 04:36 PM
Well if you look at the message received
Add request failed : INSERT INTO datastoreidentity0.HASHSET_OF_OBJECT2 (IDENTIFIER,COLLVAL,ADPT_PK_IDX) VALUES (?,?,?)
you have a field that has a serialised element. You have an ORM definition of
<field name="HashSetOfObject2" table="HASHSET_OF_OBJECT2">
    <join column="IDENTIFIER"/>
    <element column="COLLVAL"/>
</field>

So in the join table we have a FK back to the owner, a value column, and we need to impose a PK (since I have no spec that defines how to specify that no PK is required).
I don't see any primary-key specification, so how does JPOX know what is the PK of this join table ?

Andy Jefferson made changes - 16/Dec/05 04:36 PM
Assignee Andy Jefferson [ andy ] Michelle Caisse [ mcaisse ]
Repository Revision Date User Message
ASF #357291 Sat Dec 17 04:18:40 UTC 2005 mcaisse JDO-261
Files Changed
MODIFY /incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections.jdo
MODIFY /incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql
MODIFY /incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections-derby.orm
MODIFY /incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections-derby.orm
MODIFY /incubator/jdo/trunk/tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections.jdo
MODIFY /incubator/jdo/trunk/tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections.jdo
MODIFY /incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql
MODIFY /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections-derby.orm
MODIFY /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections-derby.orm
MODIFY /incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections.jdo

Michelle Caisse added a comment - 17/Dec/05 01:22 PM
Fixed with revision 357291. As the serialized elements cannot take a primary key, I removed this mapping. I changed all fields with serialized elements so that the field itself is serialized and no join table is used.

Michelle Caisse made changes - 17/Dec/05 01:22 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]