jdo

Why do my updates not work?

I am new to GAE, and to JDO, I am getting stuck with how to update data. Using the code below, if I do a getAll(), then a get() on an object, then alter an attribute for that object returned by get(), then a getAll(), the second call to getAll() returns the original un-altered object. I tried doing a flush() but that doesn't seem to he...

How do you make query results available after closing the persistence manager

I am learning GAE and am getting a bit stuck. If I use the following, with a finally to make sure the persistence manager is closed, I get an exception when trying to actually read the Note objects: public class Notes { public List<Note> getAll() { PersistenceManager pm = PMF.instance().getPersistenceManager(); try { ...

Query all entities where a "Set" matches a specific string?

How do you query for a list of objects stored using GAE, where a Set field contains a specified string? ie Imagine this imaginary example: @PersistenceCapable class Photos { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; String name = ""; Set<String> tag = new Hashset<String>(...

GAE Altering data in your local object store

I have been working on an application using GAE in eclipse and I have a bunch of data objects. Sometimes I need to change their type, ie String -> Text so they can store more data. What is the quickest easiest way to do a bulk update on the data/object store? I know I could probably write Java code to iterate over each object, but sure...

Child properties with JDO and AppEngine

I have the following code: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") public class A { @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @PrimaryKey private Key key; @Persistent private B b; @Persistent private int id; // ... } @PersistenceCapable(identityType = IdentityTy...

Google App Engine using maven

Hi all, I've been trying to create a single project which can run both on sql and gae (where the 'datanucleus.properties' file needs to be changed) under a single maven folder structure. I first tried to get the Greeting example on the GAE website using mysql (this now works). Then, inspiring myself from beardedgeeks tutorial, I have tr...

Missing dependency 'class javax.jdo.spi.PersistenceCapable$ObjectIdFieldSupplier', required by model.jar(model/error/Error.class)

I get compile errors when compiling valid code against a Java model enhanced with JDO. I am confused at the errors because there is no direct usage of the package private static member interfaces in question from Scala. I understand Scala doesn't support using such interfaces from Scala code, but I am confused that the Scala compiler com...

How to uniquely identify and fetch children objects in JDO

I am just learning JDO and GAE, and have gotten myself very stuck on this. I have gone from having just public class Article { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; ... } To now also having a parent: public class ArticleCollection { @PrimaryKey @Persistent(valu...

Updating collection of dependent objects

I have a class Event and a dependent class Entry, which instances are only valid in the context of an event. What would be the best way to model this in JDO? Acutally I don't want to query for Entries only for Events and their entries. So do I need a key on Entry? My current solution is: @PersistenceCapable public class Event { @P...

Google App Engine: Storing unowned many to many relationship

I have two objects a user and a role which I make persistant using JDO and googles app engine. The two datatypes are related to each other as unowned many to many relationship. I tried to model that much as in the gae-tutorial desribed as sets holding the key of the corresponding object. By the time I create my objects, those keys are nu...

Prepared statement parameter not being set in DataNucleus

I'm trying to insert an Employee object into the database using DataNucleus 2.1.1, but the foreign-key Position parameter is not being set before the "insert" prepared statement is executed. What am I doing that prevents the parameter from being set? Am I leaving something out? Reading works fine. DEBUG [DataNucleus.Datastore.Native]...

Google App Engine: How to "close" an object before second transaction?

Here's the psudo-code for one of my methods: 1. Get PersistenceManager (pm) 2. pm.fetchObject1 3. pm.beginTransaction 4. pm.modifyObject1 5. pm.commit 6. pm.fetchObject2 7. pm.beginTransaction 8. pm.modifyObject2 9. pm.commit however I get this error "can't operate on multiple entity groups in a single transaction..." Do I ...

Refactoring packages containing JDO @PersistenceCapable classes in Google App Engine

I have a set of JDO persistence capable classes in packages that need to be refactored. I know if you change the class name then you need to update the "BigTables" objects. However, if I change the package the java objects belong to, will this mean the data objects in "BigTables" need to be somehow updated? ie com.example.test.Person -...

Google App Engine JDO problem

How to store complex objects? I have an object in its list of child objects in the child object has four list of child objects when calling makePersistent (person) object is not saved. Help!!!!!!!!!!!! I am call pm.makePersistent(); but Lists @Persistent private List<ChoosedElementEntity> choosedElements = new ArrayList<ChoosedEl...

Why am I getting this exception in GAE

I just tested and redeployed my application to a test instance, and it worked fine, then i changed the app id and redeployed to my production instance, and I get an indexing problem. How do I avoid this in the future? I went to the effort to test it first and it worked fine! Uncaught exception from servlet com.google.appengine.api.datas...

DataNucleus and Cache Coordination

Does DataNucleus support Cache Coordination? If yes, how can I enable and use it? I'm not actively using DataNucleus yet, but I want to consider it, if it supports Cache Coordination. Background: Cache coordination is used by multiple cache instances to inform each other about changed entities (e. g. via JMS or RMI). Its purpose is to ...

Understanding if this transaction in JDO is safe

I need to take an object out of an EntityGroup and store it outside of an entity group, I think the simplest way to explain it is to show the code. In the following code, will the removeMessage() function roll back both calls to the persistence manager? Is there a way to test this, ie how do I simulate the second makePersistent request ...

Transactions over very very large entity group

I am trying to design a data model which can hold a very large amount of data, does anyone with experience in large volumes of data have any feedback on this, ie: // example only, not meant to compile public class TransactionAccount { private long balance; private List<Transaction> transactions = new ArrayList<Transaction>(); ...

How do you properly add/manipulate thousands of children in an entity group?

This further to my previous question on handling large numbers of objects in BigTables/JDO. Assuming a TransactionAccount could end up with as many as 10,000 objects in its transactions list, how does this work with Goodle app engine? How do you add objects to such a large list without the whole list being loaded into memory? (The ass...

Could not initialize class com.sample.PMF (Google app engine)

Hi, I am getting this error while trying to save something to Datastore. I have tried to search but not getting anything. This is the code where i am saving to datastore : Student temp = null; PersistenceManager pm = PMF.get().getPersistenceManager(); try { Student stu = new Student(name); temp = pm.makePers...