Hello Marc,

this maybe be blind shot, but I think i faced similar problem,
problem is I think following (although my primary key was encoded
string I believe its the same issue)

Description of problem:
    You have persisted some of you entities WITHOUT setting your
primary key (you just let it NULL),
so system generated Long.
    Later you do query or something and access Key property getName()
but since given key has id=Long it fails

So basically the exception description:
The primary key for mymodel.JarData is an unencoded string but the key
of the corresponding entity in the datastore does not have a name

is correct

Solution:
Make sure that that you always set primary key prior to saving, or if
you want to have more flexibility,
and be able to have
1)system generated ID and
2)your app generated ID

make sure you check if its Long of Unencoded String by converting
primary key to Key object and then
make checks before accessing getName() or getID() (only 1 can be set)

If I am right this has nothing to do with downtime issue.
Hope this helps you,

Marcus

On Jul 8, 11:39 am, Marc Guillemot <mguille...@yahoo.fr> wrote:
> Hi,
>
> yesterday my application worked just fine. Today data isn't reachable
> with a simple query anymore (data is here, I can find it through the
> Data Viewer).
>
> Here is the exception thrown:
> ----------------
> Uncaught exception from servlet
> The primary key for mymodel.JarData is an unencoded string but the key
> of the corresponding entity in the datastore does not have a name.  You
> may want to either change the primary key to be an encoded string (add
> the "gae.encoded-pk" extension), change the primary key to be of type
> com.google.appengine.api.datastore.Key, or, if you're certain that this
> class will never have a parent, change the primary key to be of type Long.
> org.datanucleus.store.appengine.FatalNucleusUserException: The primary
> key for mymodel.JarData is an unencoded string but the key of the
> corresponding entity in the datastore does not have a name.  You may
> want to either change the primary key to be an encoded string (add the
> "gae.encoded-pk" extension), change the primary key to be of type
> com.google.appengine.api.datastore.Key, or, if you're certain that this
> class will never have a parent, change the primary key to be of type Long.
>         at
> org.datanucleus.store.appengine.DatastoreFieldManager.fetchStringPKField(DatastoreFieldManager.java:246)
>         at
> org.datanucleus.store.appengine.DatastoreFieldManager.fetchStringField(DatastoreFieldManager.java:192)
>         at
> org.datanucleus.state.AbstractStateManager.replacingStringField(AbstractStateManager.java:1180)
> ....
> ----------------
>
> My question: how can it happen, that changes in DataStore have such
> breaking consequences? And how often will it happen?
>
> Cheers,
> Marc.
> --
> Blog:http://mguillem.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to