views:

4419

answers:

8

I want to develop my project on Google App Engine with Struts2. For the database I have two options JPA and JDO. Will you guys please suggest me on it? Both are new for me and I need to learn them. So I will be focused on one after your replies.

Thanks.

+14  A: 

JPA is Sun's standard for persistence, JDO is IMHO dying (actually, it's dead but still moving). In other words, JPA seems to be a better investment on the long term. So I guess I'd choose JPA if both were new to me.

Pascal Thivent
+1 I agree with that opinion.
KLE
JDO is not dying, and is targetted at a different audience. Please do check your facts. JDO has had JDO 2.1, JDO 2.2 and now JDO 2.3. JDO is datastore independent. JPA is targetted solely for RDBMS. Fact
DataNucleus
Well, I don't think we can say that JDO adoption is a success, no matter how much versions there are. Open your eyes, JDO could have billions of versions, nobody is using it anyway (and please, don't tell me JDO will reborn thanks to GAE). Then, if JPA is targeted solely for RDBMS, explain me why we can use this API with Google's BigTable? Thanks.
Pascal Thivent
As JPA is backed by SUN. So for its standardization, I decided to go for it. I wonder why GAE put people to think between JDO and JPA. A religious matter it could be.
Tahir Akram
+10  A: 

The GAE/J google group has several posts about this very thing. I'd do a search on there and look at people's opinions. You will get a very different message to the opinions expressed above. Also focus on the fact that BigTable is not an RDBMS. Use the right tool for the job

DataNucleus
Why does the Google App Engine supports JPA for its BigTable datastore using the datanucleus-appengine plugin (quoting http://www.datanucleus.org/products/accessplatform/appengine/support.html) if it's a total mistake? Can you elaborate on this?
Pascal Thivent
JPA support on non-RDBMS datastores involves making compromises on the API and query language. Many things don't fit so aren't supported since they are RDBMS-specific (significant parts of JPQL for example, or many JPA annotations, etc). Consequently you cannot have full portability across datastores, and so any argument for using JPA on BigTable being a straight copy across for what you'd use for an RDBMS store is false.
DataNucleus
For JDO on the other hand the query language (JDOQL) has no RDBMS-specific components, and metadata is database neutral on the whole with RDBMS-specific components separated out cleanly. Consequently you do have portability between datastores. The JDO API allows use of a native query language for each datastore where required.
DataNucleus
I never said that you can use the full JPA API but, to me, this won't prevent you from reusing your JPA knowledge so it's just not a valid reason for not using JPA. And BTW, portability accross datastores **doesn't happen in real life**.
Pascal Thivent
Whatever I say you're not going to agree so it is pointless the discussion, nor necessary of bold type. Yes portability across datastores does happen since I've got clients doing just that. As always people should decide things for themselves based on their project needs, which is what we say in the DataNucleus docs. --Andy (DataNucleus)
DataNucleus
Andy, could you give an example or 2 of BigTable features that are not available with JPA? Even example of the feature that is possible with JPA but awkwardly would work...
grigory
Use of JDO is so demotivating and depressing. In Stargate Atlantis there was a scene of Gen Oneil whacking golf balls into the ocean and I am imagining JDO as those golf balls.
Blessed Geek
Always nice when someone comes in with an intelligent comment with a nice coherent argument :-) So nothing to say then. ok
DataNucleus
I love how with GAE/J you can't use @Id as primary keys if you want to persist multiple different objects in a single transaction - you have to use Google's non-portable @Key instead.
Chris Kaminski
+7  A: 

Just saw this comparison between JPA and JDO by DataNucleus themselves:- http://www.datanucleus.org/products/accessplatform/jdo%5Fjpa%5Ffaq.html An eye-opener.

Vinod
This Datanucleus' manifesto seems to be very pro-JDO. All their statements seem critical of JPA and defensive of JDO and yet I find using JPA a happier activity than using JDO.
Blessed Geek
DataNucleus supports both JDO and JPA, and we actually just included most of JPA2 in DN 2.0. We promote both, unlike all other persistence solutions, and let users choose. If you think there are factual errors in any coverage of JDO or JPA we would welcome your input. If part of a political agenda on your behalf then you're best advised to keep your feelings to yourself
DataNucleus
http://google.com/trends?q=jdo,+jpa
matt b
A: 

Try EclipseLink. It's the upcoming JPA 2.0's reference implementation.

Zoltan
How can you try EclipseLink when the poster asked about GAE/J ? EclipseLInk supports persistence to RDBMS. This is not an RDBMS
DataNucleus
+5  A: 

I'm a happy user of JDO. Keep up the good work guys.

Manfred
+1  A: 

JPA is the way to go as it seems to be pushed as a standardized API and has recently got momentum in EJB3.0.. JDO seems to have lost the steam.

prateek mathur
+2  A: 

Go JDO. Even if you don't have experience in it, it is not hard to pick up, and you will have a new skill under your belt!

corydoras
+2  A: 

GAE/J is slated to add MYSQL before the end of the year.

Peace, Scott

stanlick
Do you have a source for this?
Taylor Leese
Downvoted because I don't think this is true, can't find any info online to support it, and there's no evidence provided with the post.
Steve Armstrong
The roadmap mentions a full featured SQL database is in the works http://code.google.com/appengine/business/roadmap.html
Ashwin Prabhu