db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Russell <Craig.Russ...@Sun.COM>
Subject Re: JIRA-70 - jdoPreClear
Date Wed, 27 Jul 2005 22:59:15 GMT
Hi Erik,

Here's the stack trace:
[java] java.lang.NullPointerException
     [java]      at  
org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass.jdoPreClea 
r(InstanceCallbackClass.java:157)
     [java]      at  
org.jpox.state.StateManagerImpl.clearFieldsByNumbers 
(StateManagerImpl.java:987)
     [java]      at  
org.jpox.state.StateManagerImpl.clearNonPrimaryKeyFields 
(StateManagerImpl.java:976)
     [java]      at org.jpox.state.PersistentClean.transitionCommit 
(PersistentClean.java:82)
     [java]      at org.jpox.state.StateManagerImpl.postCommit 
(StateManagerImpl.java:3928)
     [java]      at org.jpox.AbstractPersistenceManager.postCommit 
(AbstractPersistenceManager.java:2963)
     [java]      at org.jpox.NonmanagedTransaction.commit 
(NonmanagedTransaction.java:477)
     [java]      at  
org.apache.jdo.tck.api.instancecallbacks.CallingJdoPreclear.test 
(CallingJdoPreclear.java:127)


On Jul 27, 2005, at 12:08 PM, erik@jpox.org wrote:

>> Looking at the test case, I believe that the exception is due to a
>> bug in JPOX. I've looked at the code and the field that is accessed
>> should not be null.
>>
>
> Can you help me to understand why do you think so?
>
> - The instance is p-deleted

The stack trace shows the instance is p-clean. So this is the  
secondaryObj. It was just navigated from the primaryObj and retrieve  
was called:
         secondaryObj = primaryObj.nextObj;
         if(secondaryObj == null) {
             fail(ASSERTION_FAILED, "Failed to find secondaryObj  
created in previous transaction using reference from primaryObj.");
             return;
         }
         pm.retrieve(secondaryObj);



> - The field is not in DFG

So perhaps the problem is that retrieve() on line 117 didn't retrieve  
the children field. From the spec:

These methods request the PersistenceManager to load all persistent  
fields into the parameter instances.

> - The field access is not mediated (jdoPreClear)

So the children field should be loaded. And sadly, it's null.

One other thing to look at. Is the children field mapped correctly?

Craig
>
> Regards,
>
> Erik Bengtson
>
> Quoting Craig Russell <Craig.Russell@Sun.COM>:
>
>
>> Hi Erik,
>>
>> On Jul 27, 2005, at 11:18 AM, erik@jpox.org wrote:
>>
>>>
>>> Hi,
>>>
>>> what is the expected resolution for item 70?
>>>
>>> To remind, NullPointerException is happening while acessing a field
>>> inside the
>>> jdoPreClear in a P-Deleted instance.
>>>
>>
>> Looking at the test case, I believe that the exception is due to a
>> bug in JPOX. I've looked at the code and the field that is accessed
>> should not be null.
>>
>> Regards,
>>
>> Craig
>>
>>
>>>
>>> Regards,
>>>
>>> Erik Bengtson
>>>
>>>
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>
>>
>
>
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message