09-24-05 12:45 PM
[ [url]http://issues.apache.org/jira/browse/JDO-143?page=comments#action_12330360[/
url] ]
Andy Jefferson commented on JDO-143:
------------------------------------
Hard to follow the TCK test in terms of the data in each of the collections
so I'll post my findings here so someone who understands the data that is tr
ying to be persisted can comment. There are 2 fields of note in the Collecti
onCollections class : "Coll
ectionOfSimpleClass42", and "CollectionOfSimpleClass3".
The former has embedded elements and the latter is unembedded, just having a
FK to the SimpleClass table. Debugging suggests that both of these collecti
ons contains the same element(s). It's being encountered as part of the Coll
ectionOfSimpleClass42 field
and has a StateManager assigned (as an embedded object) and is persisted (in
to the join table). When JPOX gets around to persisting the CollectionOfSimp
leClass3 field JPOX finds the already persistent SimpleClass element and so
think it's ok to insert th
e join table row - hence the FK fails.
Do these collections contain the same elements ? If so what are you expectin
g a JDO impl to do in this situation ? Make a copy of the PC object and pers
ist that ? If so, please provide a reference to the section of the JDO2 spec
defining such behaviour.
> ERROR 23503: INSERT on table 'COLLECTION_OF_SIMPLE_CLASS3' caused a violat
ion of foreign key constraint
> --------------------------------------------------------------------------
-----------------------------
>
> Key: JDO-143
> URL: http://issues.apache.org/jira/browse/JDO-143
> Project: JDO
> Type: Bug
> Components: tck20
> Reporter: Michelle Caisse
> Assignee: Erik Bengtson
>
> [java] 1) test(org.apache.jdo.tck.models.fieldtypes.TestCollectionCollecti
ons)javax.jdo.JDODataStoreException: Add request failed : INSERT INTO applicationide
ntity0.COLLECTION_OF_SIMPLE_CLASS3 (IDENTIFIER,ALLOW_DUPLICATES,SIMPCLSREF)
VALUES (
?,?,?)
> [java] at org.jpox.store.rdbms.scostore.NormalSetStore.add(No
rmalSetStore.java:672)
> [java] at org.jpox.sco.SCOUtils.updateStoreWithCollection(SCO
Utils.java:489)
> [java] at org.jpox.store.mapping.container.CollectionMapping.
postUpdate(CollectionMapping.java:279)
> [java] at org.jpox.store.rdbms.request.UpdateRequest.execute(
UpdateRequest.java:266)
> [java] at org.jpox.store.rdbms.table.ClassTable.update(ClassT
able.java:1838)
> [java] at org.jpox.store.StoreManager.update(StoreManager.jav
a:782)
> [java] at org.jpox.state.StateManagerImpl.flush(StateManagerI
mpl.java:4298)
> [java] at org.jpox.state.StateManagerImpl.runReachability(Sta
teManagerImpl.java:3102)
> [java] at org.jpox.AbstractPersistenceManager.preCommit(Abstr
actPersistenceManager.java:3049)
> [java] at org.jpox.NonmanagedTransaction.commit(NonmanagedTra
nsaction.java:419)
> [java] at org.apache.jdo.tck.models.fieldtypes.TestCollection
Collections.runTest(TestCollectionCollections.java:97)
> [java] at org.apache.jdo.tck.models.fieldtypes.TestCollection
Collections.test(TestCollectionCollections.java:69)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeM
ethodAccessorImpl.java:39)
> [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Del
egatingMethodAccessorImpl.java:25)
> [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:2
04)
> [java] at org.apache.jdo.tck.util.BatchTestRunner.start(Batch
TestRunner.java:115)
> [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchT
estRunner.java:93)
> [java] NestedThrowablesStackTrace:
> [java] ERROR 23503: INSERT on table 'COLLECTION_OF_SIMPLE_CLASS3'
caused a violation of foreign key constraint SQL050921005031671' for key (11
27341751473). The statement has been rolled back.
> [java] at org.apache.derby.iapi.error.StandardException.newEx
ception(Unknown Source)
> [java] at org.apache.derby.impl.sql.execute.ForeignKeyRICheck
er.doCheck(Unknown Source)
> [java] at org.apache.derby.impl.sql.execute.GenericRIChecker.
doCheck(Unknown Source)
> [java] at org.apache.derby.impl.sql.execute.RISetChecker.doFK
Check(Unknown Source)
> [java] at org.apache.derby.impl.sql.execute.InsertResultSet.n
ormalInsertCore(Unknown Source)
> [java] at org.apache.derby.impl.sql.execute.InsertResultSet.o
pen(Unknown Source)
> [java] at org.apache.derby.impl.sql.GenericPreparedStatement.
execute(Unknown Source)
> [java] at org.apache.derby.impl.jdbc.EmbedStatement.executeSt
atement(Unknown Source)
> [java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement.e
xecuteStatement(Unknown Source)
> [java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement.e
xecuteUpdate(Unknown Source)
> [java] at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.
executeUpdate(NewProxyPreparedStatement.java:105)
> [java] at org.jpox.store.rdbms.scostore.BaseContainerStore.ex
ecuteUpdate(BaseContainerStore.java:97)
> [java] at org.jpox.store.rdbms.scostore.NormalSetStore.add(No
rmalSetStore.java:654)
> [java] at org.jpox.sco.SCOUtils.updateStoreWithCollection(SCO
Utils.java:489)
> [java] at org.jpox.store.mapping.container.CollectionMapping.
postUpdate(CollectionMapping.java:279)
> [java] at org.jpox.store.rdbms.request.UpdateRequest.execute(
UpdateRequest.java:266)
> [java] at org.jpox.store.rdbms.table.ClassTable.update(ClassT
able.java:1838)
> [java] at org.jpox.store.StoreManager.update(StoreManager.jav
a:782)
> [java] at org.jpox.state.StateManagerImpl.flush(StateManagerI
mpl.java:4298)
> [java] at org.jpox.state.StateManagerImpl.runReachability(Sta
teManagerImpl.java:3102)
> [java] at org.jpox.AbstractPersistenceManager.preCommit(Abstr
actPersistenceManager.java:3049)
> [java] at org.jpox.NonmanagedTransaction.commit(NonmanagedTra
nsaction.java:419)
> [java] at org.apache.jdo.tck.models.fieldtypes.TestCollection
Collections.runTest(TestCollectionCollections.java:97)
> [java] at org.apache.jdo.tck.models.fieldtypes.TestCollection
Collections.test(TestCollectionCollections.java:69)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeM
ethodAccessorImpl.java:39)
> [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Del
egatingMethodAccessorImpl.java:25)
> [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:2
04)
> [java] at org.apache.jdo.tck.util.BatchTestRunner.start(Batch
TestRunner.java:115)
> [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchT
estRunner.java:93)
> Possibly due to a misordering of inserts required for this operation?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[ Post a follow-up to this message ]
|