jdo

Accessing an custom class from a JDO Class.

Right, I don't know if I'm barking entirely up the wrong tree here - I'm finding JDO and the Google AppEngine a bit tricky to get the hang of. Anyway, here goes. I have a class that contains another class as one of it's internal variables (see player1) @PersistenceCapable(identityType = IdentityType.APPLICATION) public class JDOGa...

Google Appengine - Object with id "com.google.appengine.api.datastore.Key:Product("Potatoe")" is managed by a different Object Manager

Hi i am hitting the common error "managed by a different object manager" I have looked around online and not found a solution that fits my problem. I am calling the following code from a JSP page PersistenceManager pm = PMF.get().getPersistenceManager(); String query = "SELECT FROM " +Location.class.getName(); List<Location> locTs = (L...

How to handle updating JDO class definitions on Google App Engine

I'm using the Google app engine and JDO. What is the best way to update a JDO class definition without having to wipe the data store contents first? I'm not sure if this is specific to JDO on GAE, but I noticed that when I simply change the name of one of my persistent fields from svotes to votes, an exception is thrown (java.lang.NoSu...

Stored procedures vs JDO for data warehousing project

Hi there, In the old days we used to access the database through stored procedures. They were seen as `the better' way of managing the data. We keep the data in the database, and any language/platform can access it through JDBC/ODBC/etc. However, in recent years run-time reflection/meta-data based storage retrieval mechanisms such as...

In which release did Java Data Objects (JDO) first start allowing annotations as an alternative to XML?

My understanding is that the original incarnation of JDO required the use of XML files to describe the metadata but I see that the most recent version allows annotations. Is this correct? If so, when did annotations first become available in JDO as an alternative to XML? ...

Google app engine - what is the lifecycle of PersistenceManager?

What is the preferred way of using GAE datastore PersistenceManager for web app? GAE instructions are a bit ambiguous on the matter. Do I instantiate PersistenceManagerFactory for each RPC call, or do I use only one factory for all requests? Do I call PMF.get().getPersistenceManager(), or do I call PMF.get().getPersistenceManagerProxy()...

GWT+UIBinder+Gin+Guice+JDO+GAE example

Hi all! I'm trying to link all this technologies, but there are many isolated examples and I do not have enough experience to link them together so my questions: Whether there is a similar example? Is it possible to use UIBinder with Gin? Any recommendations to implement it? ...

How to create entities in one Entity group ?

I am building an app based on google app engine (Java) using JDO for persistence. Can someone give me an example or a point me to some code which shows persisting of multiple entities (of same type) using javax.jdo.PersistenceManager.makePersistentAll() within a transaction. Basically I need to understand how to put multiple entites i...

Need to update the primary key on existing objects in GAE Java

Hi, I am building a web app using GAE Java. I have a class that uses a Long ID (generated by appengine) as its primary key. I now want to create a new class that would be the parent class to this original class (a one to many relationship) however the child needs to have a primary key of type "key", not the Long ID I have now. What...

Can I define a read-only transaction using GAE's JDO?

I'm use the latest versions of the GWT GAE w/ JDO stack. I have a task queue updating persistent objects with the datastore. I also have a gwt user interface displaying the save objects (without modification). Given tightly defined transaction (start/commit) boundaries. Is there a way for me to define a read-only transaction for the GUI...

how to retry/recover from a java.sql.SQLexception: Concurrent Modification

Using JDO on GAE, I'm using a simple database transaction code block like below. What is a good way to retry/recover from a thrown java.sql.SQLException: Concurrent Modification? private final Provider pmp; ... PersistenceManager pm = pmp.get(); try { pm.currentTransaction().begin(); MyObject myObject= pm.getObjectById(MyObject.c...

App Engine JDO schema change. Updating new non nullable value.

The non nullable types include int and boolean. My question is how to update objects that are already persistent with a schema change adding a new variable of these types. It seems as though I cannot retrieve these objects because they now have a null variable where null is not allowed! According to: http://code.google.com/appengine/doc...

Joining multiple result set

I am trying to develop a Java application which merges data from multiple data source basically RDBMS. The scenario is some thing like this. I have creates a connection to two data sources, lets say a MSSQL database and other Oracle. Also on each connection a user can create a DataObject( a Java object) which contains a SQL query and a ...

How can I load a property lazily in JDO (on Google App Engine)?

I have this code in one of my @PersistenceCapable classes: @Persistent private Blob data; The Blob can be quite big, so I'd like to load it lazily since most of the times I don't need it. How can I annotate that property to avoid immediate loading? I could create another class that contains the Blob alone and then use a lazy one-to-on...

Why does the Google App Engine documentation emphasize JDO over JPA?

Most of the docs for Google App Engine are written for JDO. Only one page of docs are devoted to using JPA. Is this because JDO is more suited to App Engine or was there some other reason for the preferential treatment given to JDO? ...

jdo google datastore range execute exception

SELECT FROM Foo WHERE sort < sortParam PARAMETERS String sortParam ORDER BY sort RANGE 15,16 where there are less then 15 objects throws a java.lang.IllegalStateException exception. Do I just need to catch that exception to handle the case when there are fewer then 15 records, or is there something else going on that I'm...

JDO - Do I need to call DetachCopy on my model object before passing it to a view?

My understanding of detach copy is that it makes a copy of your object so that you can make changes to it without the PersistenceManager noticing. Since I close my PersistenceManager before passing the model object to the view to be used, I wouldn't have to call anything like detachCopy or makeTransient before passing it along would I? ...

JDO - Should I use detachCopy or makeTransient?

With JDO, when should I use detachCopy and when should I use makeTransient? What exactly do each of them do? ...

google App engine datastore via JPA and JDO

what are jar files needed for google App engine datastore via JPA and JDO ...

JDO - List of Strings not being retrieved from database

On my User class I have a field that is a list of strings: @Persistent private List<String> openIds; When I create a new user I do this: User user = new User(); user.openIds.add(openid); pm.makePersistent(user); When I break after that last line and look, the openIds contains the openid I put in there. But, when I later call User u...