[ 
https://issues.apache.org/jira/browse/JDO-630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799281#action_12799281
 ] 

Craig Russell commented on JDO-630:
-----------------------------------

Not clear what you are looking for. The stack trace is above:
  [java] There was 1 error: 
    [java] 1) 
testAbstractSuperclassExact(org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdExactClass)java.lang.NullPointerException
 
    [java] at 
org.datanucleus.state.JDOStateManagerImpl.cache(JDOStateManagerImpl.java:659) 
    [java] at 
org.datanucleus.ObjectManagerImpl.putObjectIntoLevel2CacheInternal(ObjectManagerImpl.java:3916)
 
    [java] at 
org.datanucleus.ObjectManagerImpl.putObjectIntoLevel2Cache(ObjectManagerImpl.java:3893)
 
    [java] at 
org.datanucleus.ObjectManagerImpl.findObject(ObjectManagerImpl.java:2821) 
    [java] at 
org.datanucleus.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1640)
 
    [java] at 
org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdExactClass.testAbstractSuperclassExact(GetObjectByIdExactClass.java:109)
 

> Support specification of exact class in SingleFieldIdentity
> -----------------------------------------------------------
>
>                 Key: JDO-630
>                 URL: https://issues.apache.org/jira/browse/JDO-630
>             Project: JDO
>          Issue Type: Improvement
>          Components: specification, tck2
>            Reporter: Andy Jefferson
>            Assignee: Craig Russell
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: jdo-630.patch
>
>
> When calling PersistenceManager.getObjectById() with a SingleFieldIdentity, 
> there seems to be no way of avoiding the following 
> (if the implementation decides to do so):
> "It is an implementation decision whether to access the data store, if 
> required to determine the exact class. This will be the case of  inheritance, 
> where multiple <code>PersistenceCapable</code> classes share the same 
> ObjectId class."
> Now when I know for sure that the targetClassName of the given 
> SingleFieldIdentity already denotes the correct class for the given id,  how 
> can I avoid that additional roundtrip to the database for finding the exact 
> class?
> It would be useful to have a way of specifying a SingleFieldIdentity to be 
> for the exact class specified. This could be done by addition of methods
> void setExact(boolean flag);
> boolean getExact();
> to SingleFieldIdentity

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to