Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8992669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:00:42+00:00 2026-06-15T23:00:42+00:00

I m using JDO version 2 Data nucleus with App engine SDK 1.7.3. I

  • 0

I m using JDO version 2 Data nucleus with App engine SDK 1.7.3. I am having problem retrieving child objects in one to many relationship.

contents = (Collection<ContentType>) persistenceManager.newQuery(ContentType.class).execute();

This query returns all instances of ContentType but ContentType also contains a list of its children “Content” which are not fetched from Database.

ContentType.java

public Collection<ContentType> getAllContents() {

        PersistenceManager persistenceManager = PersistenceFactory
                .getInstance().getPersistenceManager();
        Transaction transaction = persistenceManager.currentTransaction();
        Collection<ContentType> contents = null;
        try {
            transaction.begin();
            contents = (Collection<ContentType>) persistenceManager.newQuery(ContentType.class).execute();


            Logging.log("contents in getAllContents=== "+ contents);

            if(contents!=null)
                {
                Logging.log("contents size in getAllContents=== "+ contents.size());

                }

        for (ContentType contentTypeElement : contents) {
            Logging.log("inside main loop in getAllContents, contentTypeElement=== "+ contentTypeElement);
            if(contentTypeElement!=null)
            {
                Logging.log("inside main loop in getAllContents, contentTypeElement having list === "+ contentTypeElement.getContentList());

            }
            if(contentTypeElement.getContentList()!=null)
            {

            for (Content contentElement : contentTypeElement.getContentList()) {
                Logging.log("inside second loop in getAllContents");
                String contentPath = Constants.CONTENT_BASE_URL
                        + contentElement.getContentPath();
                contentElement.setContentPath(contentPath);
            }
            }
            Logging.log("At end of main loop iteration");
        }
        transaction.commit();
        } catch (Exception e) {
            transaction.rollback();
            e.printStackTrace();
            Logging.log("Exception retriving all content, detail in getAllContents: "
                    + e.toString());

        } finally {
            persistenceManager.close();
        }
        return contents;
    }

Here is the log

2012-12-14 13:27:14.101
org.datanucleus.TransactionImpl internalPreCommit: >> calling preCommit on org.datanucleus.store.connection.ConnectionManagerImpl$2@873b9f
I 2012-12-14 13:27:14.102
org.datanucleus.TransactionImpl internalPreCommit: >> calling preCommit on org.datanucleus.ObjectManagerImpl@c6b8b0
I 2012-12-14 13:27:14.102
org.datanucleus.TransactionImpl preFlush: >> calling preFlush on org.datanucleus.store.connection.ConnectionManagerImpl$2@873b9f
I 2012-12-14 13:27:14.102
org.datanucleus.TransactionImpl preFlush: >> calling preFlush on org.datanucleus.ObjectManagerImpl@c6b8b0
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: contents in getAllContents=== [com.test.igreetings.persistence.domain.ContentType@14fdb76, com.test.igreetings.persistence.domain.ContentType@1d15a18, com.test.igreetings.persistence.domain.ContentType@171f735, com.test.igreetings.persistence.domain.ContentType@1bf496b]
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: contents size in getAllContents=== 4
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement=== com.test.igreetings.persistence.domain.ContentType@14fdb76
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement having list === null
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: At end of main loop iteration
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement=== com.test.igreetings.persistence.domain.ContentType@1d15a18
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement having list === null
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: At end of main loop iteration
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement=== com.test.igreetings.persistence.domain.ContentType@171f735
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement having list === null
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: At end of main loop iteration
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement=== com.test.igreetings.persistence.domain.ContentType@1bf496b
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: inside main loop in getAllContents, contentTypeElement having list === null
I 2012-12-14 13:27:14.135
com.test.igreetings.util.Logging log: At end of main loop iteration
I 2012-12-14 13:27:14.136
org.datanucleus.TransactionImpl internalPreCommit: >> calling preCommit on org.datanucleus.store.connection.ConnectionManagerImpl$2@66da2c
I 2012-12-14 13:27:14.136
org.datanucleus.TransactionImpl internalPreCommit: >> calling preCommit on org.datanucleus.ObjectManagerImpl@274608

DATA NUCLEUS LOGS

1.  org.datanucleus.store.connection.ConnectionManagerImpl allocateConnection: Connection added to the pool : com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl$DatastoreManagedConnection@74ece8 for key=org.datanucleus.ObjectManagerImpl@107c76b in factory=ConnectionFactory:tx[com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl@119549e]
2.  
3.  D2012-12-14 17:20:11.232
4.  org.datanucleus.store.query.QueryManager getQueryCompilationForQuery: Query "SELECT FROM com.test.igreetings.persistence.domain.ContentType" of language "JDOQL" has been run before so reusing existing generic compilation
5.  D2012-12-14 17:20:11.232
6.  com.google.appengine.datanucleus.query.JDOQLQuery performExecute: JDOQL Query : Executing "SELECT FROM com.test.igreetings.persistence.domain.ContentType" ...
7.  D2012-12-14 17:20:11.233
8.  com.google.appengine.datanucleus.query.JDOQLQuery performExecute: Query compiled as : Kind=com.test.igreetings.persistence.domain.ContentType
9.  D2012-12-14 17:20:11.233
10. com.google.appengine.datanucleus.query.DatastoreQuery executeNormalQuery: Executing query in datastore for SELECT FROM com.test.igreetings.persistence.domain.ContentType
11. D2012-12-14 17:20:11.233
12. org.datanucleus.store.connection.ConnectionManagerImpl allocateConnection: Connection found in the pool : com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl$DatastoreManagedConnection@74ece8 for key=org.datanucleus.ObjectManagerImpl@107c76b in factory=ConnectionFactory:tx[com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl@119549e]
13. D2012-12-14 17:20:11.234
14. com.google.appengine.datanucleus.query.JDOQLQuery performExecute: JDOQL Query : Execution Time = 2 ms
15. D2012-12-14 17:20:11.279
16. org.datanucleus.ObjectManagerImpl getObjectFromLevel1Cache: Object with id "com.test.igreetings.persistence.domain.ContentType:ContentType(3)" not found in Level 1 cache [cache size = 0]
17. D2012-12-14 17:20:11.279
18. org.datanucleus.ObjectManagerImpl putObjectIntoLevel1Cache: Object "com.test.igreetings.persistence.domain.ContentType@165d118" (id="com.test.igreetings.persistence.domain.ContentType:ContentType(3)") added to Level 1 cache (loadedFlags="[NNYNN]")
19. D2012-12-14 17:20:11.279
20. org.datanucleus.state.JDOStateManager wrapSCOField: Object "com.test.igreetings.persistence.domain.ContentType@165d118" (id="com.test.igreetings.persistence.domain.ContentType:ContentType(3)") is having the value in field "endDate" replaced by a SCO wrapper
21. D2012-12-14 17:20:11.280
22. org.datanucleus.state.JDOStateManager wrapSCOField: Object "com.test.igreetings.persistence.domain.ContentType@165d118" (id="com.test.igreetings.persistence.domain.ContentType:ContentType(3)") is having the value in field "startDate" replaced by a SCO wrapper
23. D2012-12-14 17:20:11.280
24. org.datanucleus.ObjectManagerImpl enlistInTransaction: Object "com.test.igreetings.persistence.domain.ContentType@165d118" (id="com.google.appengine.api.datastore.Key:ContentType(3)") enlisted in transactional cache
25. D2012-12-14 17:20:11.280
26. org.datanucleus.ObjectManagerImpl getObjectFromLevel2Cache: Object with id="com.test.igreetings.persistence.domain.ContentType:ContentType(3)" taken from Level 2 cache (fields="[0, 1, 2, 3, 4]", version="") - represented as "com.test.igreetings.persistence.domain.ContentType@165d118"
27. D2012-12-14 17:20:11.280
org.datanucleus.store.connection.ConnectionManagerImpl allocateConnection: Connection found in the pool : com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl$DatastoreManagedConnection@74ece8 for key=org.datanucleus.ObjectManagerImpl@107c76b in factory=ConnectionFactory:tx[com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl@119549e]

So contentList is fetched empty although in admin console Data viewer there are many instances of Content associated with Content Types. What am i missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:00:44+00:00Added an answer on June 15, 2026 at 11:00 pm

    Since you now say that there is no property in ContentType for the List then you didn’t persist the data with v2 of the GAE JDO plugin. Consequently you can’t expect it to know about elements in the Collection.

    Solution : fix your data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the local-development version of App Engine's JDO implementation. When I query
I am using Google App Engine with Google's JDO implementation to save an entity
I'm working on an app engine project (java). I'm using the jdo interface. I
I have a problem with the Google App Engine JDO implementation that I cannot
I am newbie to Google app engine and Data nucleus. The following error seems
I want to upload one image to the database by using Google app engine
To identify my JDO objects in Google App Engine I use the Key type.
I am trying to run grails on google app engine using JDO, but I
I'm using the Google app engine and JDO. What is the best way to
Most of the docs for Google App Engine are written for JDO. Only one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.