Issue Details (XML | Word | Printable)

Key: NUCAPIJDO-29
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: No Testcase No Testcase
Assignee: Unassigned
Reporter: tyson malchow
Votes: 0
Watchers: 0
Operations

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

NPE in PersistableMapping

Created: 28/Apr/12 02:54 AM   Updated: 14/May/12 01:16 PM   Resolved: 01/May/12 06:49 AM
Component/s: API
Affects Version/s: None
Fix Version/s: None

Datastore: MySQL
Severity: Production


 Description  « Hide
against release 3.0.10, PersistableMapping.java line 1064 NPEs when the result of the prior line (mmd.getRelatedMemberMetaDataForObject) is null.

relevant stacktrace:

        at org.datanucleus.store.mapped.mapping.PersistableMapping.postInsert(PersistableMapping.java:1064)
        at org.datanucleus.store.rdbms.request.InsertRequest.execute(InsertRequest.java:517)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertTable(RDBMSPersistenceHandler.java:163)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:139)
        at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2371)
        at org.datanucleus.state.JDOStateManager.makePersistent(JDOStateManager.java:2347)
        at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1798)
        at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1886)
        at org.datanucleus.store.mapped.mapping.PersistableMapping.setObjectAsValue(PersistableMapping.java:665)
        at org.datanucleus.store.mapped.mapping.PersistableMapping.setObject(PersistableMapping.java:425)
        at org.datanucleus.store.rdbms.fieldmanager.ParameterSetter.storeObjectField(ParameterSetter.java:210)
        at org.datanucleus.state.AbstractStateManager.providedObjectField(AbstractStateManager.java:1452)
        at com.webtab.core.data.MerchantLocation.jdoProvideField(MerchantLocation.java)
        at com.webtab.core.data.MerchantLocation.jdoProvideFields(MerchantLocation.java)
        at org.datanucleus.state.AbstractStateManager.provideFields(AbstractStateManager.java:1520)
        at org.datanucleus.store.rdbms.request.InsertRequest.execute(InsertRequest.java:478)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertTable(RDBMSPersistenceHandler.java:163)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:139)
        at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2371)
        at org.datanucleus.state.JDOStateManager.makePersistent(JDOStateManager.java:2347)
        at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1798)
        at org.datanucleus.ObjectManagerImpl.persistObjectWork(ObjectManagerImpl.java:1647)
        at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1504)
        at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:740)
        at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:765)
        at com.webtab.core.dao.MerchantLocationDAO.save(MerchantLocationDAO.java:20)


Andy Jefferson added a comment - 28/Apr/12 08:47 AM
No testcase

Andy Jefferson made changes - 28/Apr/12 08:47 AM
Field Original Value New Value
Priority Major [ 3 ] Incomplete [ 6 ]
tyson malchow added a comment - 01/May/12 12:00 AM
i don't have time for a testcase so i won't be providing one, i just figured you'd care that DN is NPE'ing (which shouldn't be possible). at least please add an assertion or SOMETHING in case someone else runs into this.

we have created a hacky workaround in our own code so we won't be revisiting this - instead of connecting everything and then calling makePersistent, i called makePersistent on an empty object and then later assign the relationships which seemed to fix the issue.

Andy Jefferson made changes - 01/May/12 06:49 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 14/May/12 01:16 PM
Status Resolved [ 5 ] Closed [ 6 ]