Hi John, You just need to read the entity group references above and it will be clearer.
Appengine is a distributed datastore in which the files and entities within are not necessarily co-located. If you need to retrieve more than one type of entity within a transaction, those entities need to have relationships that you have defined using structure within appengine. Without those relationships you have this: create entity Sale (it lives in filesystem 1234567) create entity RegularUser (it lives in filesystem 231) Create a new entity with those. The new entity lives in filesystem 123. If you have not created the implicit indexes by using cross group transactions, nor have you created entity groups by giving the entities a common ancestor, the entity manager will not have the information it needs to locate all of the fields... There's more to it than that, but that is the simplest way to explain it. Cheers, Nichole On Feb 2, 4:19 am, John Goche <johngoch...@googlemail.com> wrote: > NIchole, > > Thank you for your feedback, but how do I change my code so that I have > this entity group you are mentioning? I am using the HR datastore. And > how did you get to this conclusion? > > I am fetching every store from the datastore, detaching everything after > making it persistent, and always touching fields before accessing them, > so why are things not working out? > > @PersistenceCapable(detachable="true") > class ZZZStore { > > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Key key; > > @Persistent > private AdminUser admin; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > //@Order(extensions = @Extension(vendorName="datanucleus", > key="list-ordering", value="email asc")) > private List<RegularUser> users; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > //@Order(extensions = @Extension(vendorName="datanucleus", > key="list-ordering", value="itemCode asc")) > private List<Item> inventory; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > //@Order(extensions = @Extension(vendorName="datanucleus", > key="list-ordering", value="receiveDate asc, receiptID asc")) > private List<Receipt> receipts; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > //@Order(extensions = @Extension(vendorName="datanucleus", > key="list-ordering", value="saleID asc")) > private List<Sale> sales; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > //@Order(extensions = @Extension(vendorName="datanucleus", > key="list-ordering", value="shipDate asc")) > private List<Shipment> shipments; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > //@Order(extensions = @Extension(vendorName="datanucleus", > key="list-ordering", value="cusID asc")) > private List<Customer> customers; > > //@Persistent(defaultFetchGroup = "true") > @Persistent > @Element(dependent = "true") > private Company company; > > } > > @PersistenceCapable > class Sale { > > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Key key; > > @Persistent > private long saleID; > > @Persistent > private Date saleDate; > > @Persistent > private String cusID; > > @Persistent > private String repID; > > @Persistent > //@Persistent(defaultFetchGroup = "true") > private List<SaleItem> saleItems; > > } > > static void persistStore() { > > PersistenceManager pm = PMF.get().getPersistenceManager(); > Transaction tx = pm.currentTransaction(); > try { > tx.begin(); > pm.makePersistent(Data.store); > tx.commit(); > } finally { > if (tx.isActive()) > tx.rollback(); > pm.close(); > } > > } > > > > > > > > On Thu, Feb 2, 2012 at 11:01 AM, Nichole <nichole.k...@gmail.com> wrote: > > you need an entity group > > > > http://code.google.com/appengine/docs/java/datastore/jdo/relationship... > > > or cross group transactions if you are using the HR datastore: > > > > http://code.google.com/appengine/docs/python/datastore/transactions.html > > > or If you are not on the HR datastore and need2-phaselocking > > transactions: > > >http://groups.google.com/group/google-appengine-java/browse_thread/th... > > > On Feb 1, 10:25 am, John Goche <johngoch...@googlemail.com> wrote: > >> Hi, > > >> I've raised the issue with a test case in google's issue tracker: > > >>http://code.google.com/p/datanucleus-appengine/issues/detail?id=259 > > >> I am hoping someone can kindly have a look at it and get back to me > > >> as I cannot see how I can make use of JDO on app engine without this fixed. > > >> In the meantime any suggestions on how to work around the problem would > > >> be greatly appreciated. > > >> Kind Regards, > > >> John Goche > > >> On Wed, Feb 1, 2012 at 9:21 AM, datanucleus <andy_jeffer...@yahoo.com> > >> wrote: > >> > So it can't find a related Entity. You could obviously use the DB > >> > viewer (or a low level API call) to check whether it is present (with > >> > that Key), and look in the log for whether it was PUT. > > >> > Can't speak for Google but I'm sure nobody has interest in private > >> > code, though I'm sure that it ought to be perfectly simple to generate > >> > a testcase something akin to the format used by DataNucleus > >> >http://www.datanucleus.org/project/problem_jdo_testcase.html > >> > if the issue is as clear as you say in terms of reproducing it. And > >> > then you can raise an issue in Googles issue tracker with the > >> > testcase; obviously without the testcase then nobody, other than you, > >> > can see it. > > >> > -- > >> > 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-java@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > google-appengine-java+unsubscr...@googlegroups.com. > >> > For more options, visit this group > >> > athttp://groups.google.com/group/google-appengine-java?hl=en. > > > -- > > 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-java@googlegroups.com. > > To unsubscribe from this group, send email to > > google-appengine-java+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-appengine-java?hl=en. -- 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-java@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.