jdo

Exception: Query result sets are not modifiable

I'm trying to write to a JDO store using this code: PersistenceManager pm = PMF.get().getPersistenceManager(); try { pm.currentTransaction().begin(); // deactivate all for current domain Query q = pm.newQuery(CampaignStore.class, "domain == '" + domain +"'"); Collection result = (Collection) q.e...

Where can I find more diagnostic information about datastore behavior?

I'm using google app engine and its datastore to store a JDO Entity, called A. Class A has a @Persistent member of type B. I'm making changes to A, everything works fine... except this B member is never recorded in the datastore (I don't think). Changes to B don't show up, every fetch I do has B has null even though I clearly set it t...

JDO design tool for GAE?

Hi, Is there a free JDO designer tool that will work nicely with Google App Engine projects? (I'm working in Eclipse) I need something to create some classes visually, then it could create/update my classes in certain packages. Something like Javelin, but a free alternative and something that is especially designed to work together wit...

Protocol Buffers vs JDO on Google App Engine

I'm working on a mobile app that will get data from GAE, and I'm trying to decide between using Protocol Buffers and JDO. First off, I'm not sure how to make PBs persistent. I know it's just a matter of the annotation tags with JDO. I also saw this thread where they warn that PB data can't be indexed. I'm not sure if that's a problem...

JDOQL Subquery count problems

I am having trouble with subquery counts with JDOQL (using DataNucleus). The following query SELECT this.price FROM com.mysema.query.jdo.test.domain.Product WHERE (SELECT count(other) FROM com.mysema.query.jdo.test.domain.Product other WHERE other.price > this.price) > a1 PARAMETERS java.lang.Long a1 causes the Exception javax.jdo.JD...

How to add primitive property to existing java datastore entity to avoid null pointer exception

I have existing entities of a type in my gae datastore to which i want to add a new primitive property of primitive type "long": @Persistent private long bests = 0; When I do this, when i try to load existing entities which obviously don't have this property set yet, i get: java.lang.NullPointerException: Datastore entity wi...

How do I use GAE datastore transactions with many-to-many relationships?

I have a data module that includes Vendor objects and VendorCategory objects. Each vendor has multiple categories, and each category can have multiple vendors. I need to list all vendors under a given category, and all categories under a given vendor. The primary operations are on vendors, so I'm writing code to update/delete VendorCate...

With JDO, is it possible to query for all objects that implement a particular interface?

I tried using the following query: Query q = getPersistenceManager().newQuery( getPersistenceManager().getExtent(ICommentItem.class, false) ); but got: org.datanucleus.exceptions.NoPersistenceInformationException: The class "com.sampleapp.data.dataobjects.ICommentItem" is required to be persistable yet no Meta -Data/Annotations c...

Different classloaders cause ClassCastException when persisting data via Spring

I'm creating an MVC Spring webapp. Using: Jetty (servlet container), DataNucleus (dao platform), DB4O (embedded datastore). When I persist an object (done from within a Spring Controller) using JDO from DataNucleus, it stores to the DB fine. @PersistenceCapable public class Test { @Persistent private String testString; //g...

ClassCastException in DataNucleus DAO object when persisting/retreiving an Object using JDO

I've created a simple webapp using Spring & Jetty, and am creating a hello world JDO test using DataNucleus & DB4O. I can persist a class no problem, but when I go to query for the class I get a ClassCastException, can't cast a.b.c.MyClass to a.b.c.MyClass. When I examine the classloader of the original object I created, it's [WebAppCl...

JDO not retrieving/persisting a collection

I have the following data model class defined: @PersistenceCapable public class TestSerializableModelObj { @Persistent(serialized="true", defaultFetchGroup="true") private MyPOJO myField; @Persistent(serialized="true", defaultFetchGroup="true") private Collection<MyPOJO> myCollection; // getter/setters } MyPOJO i...

makePersistent is appending elements to my list instead of replacing the list

I'm using the GAE datastore with JDO to hold course information. Each Course has a List of GradeDefinition objects (e.g. "A=90%+", "B=80%+", etc) When I try to change the List, the new elements are simply appended behind the old elements. I suspect there is a problem with the way I am using detachable objects and persistence managers....

When should I call javax.jdo.Query.close(Object)?

I'm trying to understand when I should call Query.close(Object) or Query.closeAll(); From the docs I see that it will "close a query result" and "release all resources associated with it," but what does "close" mean? Does it mean I can't use objects that I get out of a Query after I've called close on them? I ask because I'm trying to...

Why get a DeadlineExceededException in MakePersistentAll from app engine data store?

Folks -- I am getting the following exception and can't explain why. The number of objects to persist are usually small (<10), but I get a DeadlineExceededException intermittently when using makepersistentall from the persistencemanager. The http request code also handles other queries into the datastore prior to the makepersistentall ...

JDO: Is the PersistenceManager a singleton?

Just the basics: I'm using DataNucleus backed with an embedded DB4O database. If I do this simple test: PersistenceManager pm1 = persistenceManagerFactory.getPersistenceManager(); PersistenceManager pm2 = persistenceManagerFactory.getPersistenceManager(); pm1.makePersistent(t1); pm2.makePersistent(t2); I get a file l...

JDO + GoogleAppEngine - search class by value in collection

Hi, I'm making application running on Google App Engine and I'm having problem with getting data using JDO. I have class Message, which has property private List<String> labels;. Now I want to have some search function which takes one string (label) as a parameter and searches all messages to get messages with given label. The problem ...

Fix app engine types

I recently made a change to one of my app engine models. I changed a Key field to a String. I forgot to remove all the old records. I have already added new records that have strings in the key fields. If I do a query for all the records I get an error, can not cast Key to String. If I try and change the class back to the old way I ...