App engine Datastore entities became unavailable after migrating to JDO 3.0

55 views
Skip to first unread message

Malleswari Srinivasarao

unread,
Apr 20, 2015, 9:33:51 AM4/20/15
to google-a...@googlegroups.com

I'm using App engine JDO, for storing my data in database and I use appengine plugin for eclipse for deploying my application.

I created some bean classes and deployed. While deploying, I did not choose any version of DataNucleus JDO/JPA. It was empty as shown in the picture.

As a result, I could see my datastore kinds and entities got created with the strange casing, which was not same I named those. (Even I could find the same in development environment as well).

I have given my kind name as WorkUser, but it got created like WORKUSER (upper case), similarly, all field names, for eg., I created accessToken in my bean class, it got turned into ACCESS_TOKEN.

Although everthing works fine for some days, I wanted to migrate my JDO to JDO 3.0 and now, while deploying, I have chosen Datanucleus version to v2



Did necessary configurations for migration. The issue I found now, is none of the entities are available to query from code. I could see all kinds and entities present in appengine console, but, when I'm trying to fetch the data, I'm getting empty results.

How can I make my data to be fetchable ?

Any help would be greatly needed and appreciated. Thanks.

Vinny P

unread,
Apr 21, 2015, 12:17:51 AM4/21/15
to google-a...@googlegroups.com
On Mon, Apr 20, 2015 at 8:33 AM, Malleswari Srinivasarao <malleswari....@a-cti.com> wrote:

Did necessary configurations for migration. The issue I found now, is none of the entities are available to query from code. I could see all kinds and entities present in appengine console, but, when I'm trying to fetch the data, I'm getting empty results.

How can I make my data to be fetchable ?



Can you query for and print out all entities with a kind of __Stat_Kind__? This should show a list of the kinds in your application - you may be accidentally querying for the wrong entity kind, or perhaps the migration introduced new/unknown kinds. For each kind that you see, can you try programmatically retrieving a sample of the entities within?

 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

 

Malleswari Srinivasarao

unread,
Apr 21, 2015, 10:03:49 AM4/21/15
to google-a...@googlegroups.com
Thank for your response Vinny. 

I tried getting entities and kinds as you said. I could see the same results which I could find in both app engine 'DataStore Statistics' page and in my loggers. 

I would like to know one thing, why my 'Kind' and 'Property' names had been changed.? 

For instance, I gave my JDO name as 'UserWorkLogs', but it appeared in app engine console as 'USERWORKLOGS',
I gave my one of properties name as 'AccessToken', but it got saved as 'ACCESS_TOKEN'.

As the case-sensitivity was there, after migrating to the JDO 3.0, I was unable to fetch the data, which I was able to do before migration.

By the way, I dint change anything in code for fetching data. I used to query like, 

PersistenceManager pm = PersistenceManagerUtil.getPersistanceManager();
Query q = pm.newQuery(UserWorkLogs.class);

The above code gave me all entities in the 'UserWorkLogs' JDO, before migration. I was getting empty results after migrating to JDO 3.0

But, I'm able to get the data even after migration with the following code,

PersistenceManager pm = PersistenceManagerUtil.getPersistanceManager();
Query q = pm.newQuery(USERWORKLOGS.class);


Could you please let me know what's the reason behind changing the case of Kind and property names.?

Thanks.

On Tuesday, April 21, 2015 at 9:47:51 AM UTC+5:30, Vinny P wrote:

Vinny P

unread,
Apr 21, 2015, 12:41:17 PM4/21/15
to google-a...@googlegroups.com
On Tue, Apr 21, 2015 at 9:03 AM, Malleswari Srinivasarao <malleswari....@a-cti.com> wrote:
Thank for your response Vinny. 

Could you please let me know what's the reason behind changing the case of Kind and property names.?



Check your datanucleus configuration file; specifically, you want to look for the following two properties: datanucleus.identifier.wordSeparator and datanucleus.identifier.case. It sounds like these properties were set in your configuration file to insert underscores as the word separator (first property) and to uppercase the property name (second property). 

I believe the underscore is the default word separator, so if you're missing the properties entirely they may have been set to their default values.
Reply all
Reply to author
Forward
0 new messages