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

  • Home
  • SEARCH
  • 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 8476521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:12:08+00:00 2026-06-10T18:12:08+00:00

I have two classes, each of which are PersistentCapable- an Event and a Score

  • 0

I have two classes, each of which are PersistentCapable- an Event and a Score class.
The Event class contains an ArrayList of Scores.

I have a method that builds up a List of Events, then tries to save the Events and their corresponding Scores to the datastore using

PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
            pm.makePersistentAll(Event.getEvents());
        } finally {
            pm.close();
        }

The Events all save to the datastore fine (I can see them all at /_ah/admin).
The Scores, however, do not save (at least most of them don’t).

All of the scores from the first Event save, but non of the other Event’s Scores do.
All of the events have scores, and the lists are populated prior to trying to save to the datastore.

My call to makePersistentAll() is also throwing javax.jdo.JDOUserException: One or more instances could not be made persistent

Finally, I can see in the datastore admin that though the Events are all being saved, their score value is a list of a bunch (~15) null values. All other values are correct.
The Keys are all unique as well (though I am manually generating those).

Any ideas on what is going wrong?

Event:

@PersistenceCapable(detachable="true")
public class Event {
    @NotPersistent
    protected static ArrayList<Event> events = new ArrayList<Event>();

    @PrimaryKey
    @Persistent
    private Key key;

    @Persistent
    private String name;
    @Persistent
    private String date;
    @Persistent
    private String year;
    @Persistent
    private String scoresUrl;
    @Persistent
    private ArrayList<Score> scores;

Score:

@PersistenceCapable(detachable="true")
public class Score {
    @PrimaryKey
    @Persistent
    private Key key;
    @Persistent
    private Key eventKey;
    @Persistent
    private String unitName;
    @Persistent
    private int place;
    @Persistent
    private float score;

After setting .level = FINEST in logging.properties, I see three entries that I think might be causing the problem just after all of the Events are saved. It appears as though the connection is being closed before the makePersistentAll() can get down to the Score objects.

Aug 17, 2012 2:15:42 PM org.datanucleus.store.connection.ConnectionManagerImpl closeAllConnections
FINE: Connection found in the pool : com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl$DatastoreManagedConnection@77a477b7 for key=org.datanucleus.ObjectManagerImpl@45e4d960 in factory=ConnectionFactory:nontx[com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl@4eafccbe] but owner object closing so closing connection
Aug 17, 2012 2:15:42 PM org.datanucleus.store.connection.ConnectionManagerImpl$1 managedConnectionPostClose
FINE: Connection removed from the pool : com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl$DatastoreManagedConnection@77a477b7 for key=org.datanucleus.ObjectManagerImpl@45e4d960 in factory=ConnectionFactory:nontx[com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl@4eafccbe]
Aug 17, 2012 2:15:42 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: /scores
javax.jdo.JDOUserException: One or more instances could not be made persistent
  • 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-10T18:12:09+00:00Added an answer on June 10, 2026 at 6:12 pm

    As per Shivan Dragon’s suggestion, I moved from using a PersistenceManager to doing everything within a transaction.

    It doesn’t look nearly as neat (because I need to explicitly set each property), but it now works as expected and no longer throws an Exception.

    I’m decidedly okay with the extra clutter, as this method also gives me better control over when to and when not to save my data for individual Entities to the datastore.

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

Sidebar

Related Questions

I need to have two classes, one class has two methods each of which
I have two classes which I need to reference each other. class Foo {
I have two classes that refer to each other, but obviously the compiler complains.
I have two classes (MVC view model) which inherits from one abstract base class.
I have two classes Foo and Bar that Bar extends Foo as below: class
I have two classes, one that inherits from the other. The base class is
I have a script which contains two classes. (I'm obviously deleting a lot of
I have two classes which depend on each other. I've solved this problem before
I have two classes(Book,Software) that inherit from the Product class. these two classes have
If I have two classes that each extend a common parent, is it possible

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.