backupCloneIsOriginalFromParent Exception
426437Apr 28 2005 — edited Feb 28 2007 Argh, we got this incredible showstopper:
Using OracleAS TopLink - 10g (9.0.4.5) (Build 040930) and the Spring Integration.
1. Use the PlatFormTransactionManager to get a transaction and transactionstatus.
2. Read a collection of objects from the database using TopLinkCallback and session.executeQuery
3. Register all objects in the collection with session.getActiveUnitOfWork().registerAllObjects(collection)
4. Return the collection that is the result of registerAllObjects() (the clones)
5. Modify the registered objects
6. Commit the transaction
This results in the following:
Exception [TOPLINK-6004] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.QueryException
Exception Description: The object [model.value.external.tachonet.db.MsToTcnRequestMessage@18df2e4], of class [class value.external.tachonet.db.MsToTcnRequestMessage], with identity hashcode (System.identityHashCode()) [26,079,972],
is not from this UnitOfWork object space, but the parent session's. The object was never registered in this UnitOfWork,
but read from the parent session and related to an object registered in the UnitOfWork. Ensure that you are correctly
registering your objects. If you are still having problems, you can use the UnitOfWork.validateObjectSpace() method to
help debug where the error occurred. For more information, see the manual or FAQ.
at oracle.toplink.exceptions.QueryException.backupCloneIsOriginalFromParent(QueryException.java:153)
at oracle.toplink.publicinterface.UnitOfWork.getBackupClone(UnitOfWork.java:1536)
at oracle.toplink.publicinterface.UnitOfWork.calculateChanges(UnitOfWork.java:438)
at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1135)
at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(UnitOfWork.java:956)
at oracle.toplink.publicinterface.UnitOfWork.commit(UnitOfWork.java:771)
at org.springframework.orm.toplink.TopLinkTransactionManager.doCommit(Unknown Source)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:401)
at services.gateway.TACHOnetServiceImpl.sendBatchMessage(TACHOnetServiceImpl.java:751)
at services.gateway.TACHOnetServiceImpl.sendBatchMessages(TACHOnetServiceImpl.java:827)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:221)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
This even occurs when I don't modify the objects, just commit at the end! Does anyone have ANY idea what the cause of this can be? This is a real showstopper for us. :(
The collection retrieved above also has relations to other objects. I suspect the error occurs because we don't clone them to, but how do you do this when there are heaps of relations? Should I clone each separate and assign it back to the first clone? The relations are already there before cloning, I shouldn't have to maintain them should I?
Regards,
Anders,