Have you tried using the two parameter getObjectById that takes the
JDO entity class type as the first parameter which I would presume
(but not verified) then doesn't need to inspect the supplied string to
determine the entity kind?

On Thu, Jul 7, 2011 at 10:38 AM, Carter <[email protected]> wrote:
> This problem is specific to Java JDO implementation.
> Do you agree that this should be filed as a bug? (i.e. key names
> should be opaque strings rather than interpreted by JDO to determine
> entity kind?)
>
> getObjectById() is using only the first part of the supplied keyString
> as the *whole* key in determining the Kind being retrieved.
> We had expected it to use the entire keyString - without interpreting
> the fact that the first part of the key name contains the keyString of
> another Kind of Entity.
>
> As background, we're using the keyString of one Kind (say, "Bean") as
> *part* of the key name for another Kind (say, "Counter").
> When using getObjectById(keyString counterName dateString), we get an
> exception since the first part of the key name is the keyString of
> another Kind.
> But when using getObjectById(counterName keyString dateString), we're
> fine.
> So simply switching the order of the elements of the key name string
> is a workaround for this bug that produces this Exception (edited for
> clarity):
>
> Caused by: javax.jdo.JDOFatalUserException: Exception converting
> agxjYW1sb2d2aWV3ZXJyDwsSB0FwcFVzZXIYybgDDA counter1 2011-07-07  to an
> internal key.
> NestedThrowables:
> org.datanucleus.store.appengine.FatalNucleusUserException: Received a
> request to find an object of kind Counter but the provided identifier
> is the String representation of a Key for kind Bean
>        at
> org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.getObjectById(DatastoreJDOPersistenceManager.java:
> 68)
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to