Issue Details (XML | Word | Printable)

Key: NUCCORE-284
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: Dan Leary
Votes: 0
Watchers: 2

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

Attaching detached object throws: Object ... is managed by a different Object Manager

Created: 13/Jun/08 09:31 PM   Updated: 11/Sep/09 08:39 AM   Resolved: 25/Aug/09 09:03 AM
Component/s: None
Affects Version/s: 1.0.0.m2
Fix Version/s: None

File Attachments: 1. Zip Archive (2 kB)

openSUSE 10.3 (X86-64)
Oracle Database 10g Release - 64bit Production
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)
Nightly 1.0-SNAPSHOT jars from 2008-06-13

Datastore: Oracle

 Description  « Hide
I'm getting an unexpected exception:

16:19:03,587 (main) INFO [DataNucleus.JDO] - >> Exception thrown deleting object
javax.jdo.JDOUserException: Object with id "1[OID]org.datanucleus.test.A" is managed by a different Object Manager
        at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(
        at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(
        at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(
        at org.datanucleus.test.Main.delete(
        at org.datanucleus.test.Main.main(
Object with id "1[OID]org.datanucleus.test.A" is managed by a different Object Manager
org.datanucleus.exceptions.NucleusUserException: Object with id "1[OID]org.datanucleus.test.A" is managed by a different Object Manager
        at org.datanucleus.ObjectManagerImpl.findStateManager(
        at org.datanucleus.ObjectManagerImpl.isInserting(
        at org.datanucleus.ObjectManagerImpl.attachObject(
        at org.datanucleus.state.AbstractStateManager.providedObjectField(
        at org.datanucleus.test.A.jdoProvideField(
        at org.datanucleus.test.A.jdoProvideFields(
        at org.datanucleus.state.JDOStateManagerImpl.provideFields(
        at org.datanucleus.state.JDOStateManagerImpl.attach(
        at org.datanucleus.ObjectManagerImpl.attachObject(
        at org.datanucleus.ObjectManagerImpl.persistObjectInternal(
        at org.datanucleus.ObjectManagerImpl.persistObject(
        at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(
        at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(
        at org.datanucleus.test.Main.delete(
        at org.datanucleus.test.Main.main(

When attempting to reattach a previously detached PC instance.
The attached test case assumes DetachAllOnCommit=true and CopyOnAttach=false

Dan Leary added a comment - 13/Jun/08 09:32 PM
Testcase attached.

Dan Leary made changes - 13/Jun/08 09:32 PM
Field Original Value New Value
Attachment [ 10762 ]
Renato Garcia added a comment - 28/Jan/09 07:42 PM
You need to close the pm.

Add this to your code:


in the following lines:

   finally { if (tx.isActive()) tx.rollback(); }

should be like this

   finally { if (tx.isActive()) tx.rollback(); pm.close()}

This should solve the current exception.

Andy Jefferson made changes - 01/May/09 03:03 PM
Project DataNucleus Access Platform [ 10140 ] DataNucleus Core [ 10143 ]
Affects Version/s 1.0.0.m2 [ 10352 ]
Affects Version/s 1.0.0.m2 [ 10353 ]
Andy Jefferson added a comment - 25/Aug/09 09:03 AM
Doesn't demonstrate anything that I can see. As already mentioned, creating a PM and not closing it is a strange coding practice

Andy Jefferson made changes - 25/Aug/09 09:03 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 11/Sep/09 08:39 AM
Status Resolved [ 5 ] Closed [ 6 ]