[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread jeremy rose



On Sep 15, 2:46 am, WilliamF  wrote:
> As leszek says I think you have a few things confused:
>
> DataNucleus is a JDO/JPA implementation that can run within AppEngine.
>
> AppEngine provides 2 persistence mechanisms, BigTable and VFS (Virtual
> File System). You cannot configure your GoogleApp to use an external
> RDBMS, nor can you host an RDBMS within your GoogleApp. Also note that
> with each DB record, BigTable effectively stores not only the data but
> also the metadata for the table. Ie all the column names are stored
> alongside the column data, for each record. So a Gigabyte of data will
> commonly consume 10GB of space within BigTable.
>
> Using GWT on your client is orthogonal, to the persistence on the
> server.
>
> However, if you have a clean JPA (non-Hibernate specific)
> implementation you might have a way continue to use JPA within your
> GoogleApp by using a H2 RDBMS implementation running on top of VFS.
> Seehttp://groups.google.com/group/google-appengine-java/browse_thread/th...
> and
>    http://groups.google.com/group/gaevfs/browse_thread/thread/c23b8af579...
>
> On a side note, Andy (aka Datanucleus) you need to chill dude.
> Users are reporting problems with Datanucleus because they are feeling
> pain.
> Barking at them is not the way to win support and market share for
> Datanucleus, quite the opposite.
>
> William

Yes, I certain was (maybe still am) confused but thanks for helping
reset my expectations.  At this point appengine is looking like a tool
for experimenting a rapidly building prototypes.   Perhaps plugging in
existing databases through standard interfaces such as JDO or JPA will
come later.

BTW, I never perceived Andy's responses as "barking" although I know I
was doing a little barking myself.   I appreciate the help both of you
have provided.   I thought I was struggling through inadequate
documentation but apparently I was looking for something that doesn't
exist (at least not yet).

Jeremy
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread jeremy rose


On Sep 15, 3:32 am, leszek  wrote:
> Nobody can contradict that DataNucleus is a high quality software. The
> fact that it is Google's persistence provider of choice speaks for
> itself.

I haven't had the pleasure of really using DataNucleus (at least not
yet) but I'm willing to believe its great software.  I'm just a bit
perplexed by step one of the development process (at least using GWT
with appengine) being migrate your data to a different database (even
if it is technologically superior).   Obviously, the target is green
field development where "mega-bunches" of data haven't already been
collected from prior work.

Jeremy
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread jeremy rose



On Sep 15, 12:30 am, leszek  wrote:
> Sorry, but I'm afraid that you are completely on the bad track :
>
> - Google App Engine JPA supports only some subset of JPA
> implementation, it is unlikely that your existing-not trivial  JPA
> application will migrate to Google App Engine without hefty coding.
> More probably that you can migrate smoothly to the "pure" DataNucleus
> - just opposite as you mean.
> - Google App Engine does not support any RDBD database, the only
> persistence layer supported is 'datastore' backed by Google Big Table.
>
> I suggest you  to read :http://code.google.com/appengine/docs/java/datastore/
>
> Although it is focused on JDO it is also relevant to JPA. The
> underlying technology (Big Table) is exactly the same.


Thanks for clarifying this for me.  So, I guess I will focus on using
the GWT without appengine rather than using appengine without Data
Nucleus.

Jeremy
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-14 Thread jeremy rose



On Sep 14, 7:57 pm, jeremy rose  wrote:
> On Sep 14, 6:06 am, leszek  wrote:
>
>
>
>
>
> > Hibernate is not JPA implementation, it exposes its own API.
> > "Hibernate Entity Manager" is a product build on standard Hibernate
> > and offering full JPA interface.
>
> > Google App Engine does not support 
> > Hibernate:http://groups.google.com/group/google-appengine-java/web/will-it-play...
> > -
> > Hibernate
> > Versions: All
> > Status: INCOMPATIBLE
>
> >     * You cannot currently use Hibernate directly. The differences
> > between the App Engine datastore and SQL were too great to get the
> > standard Hibernate up and running under App Engine. App Engine does
> > support JDO and JPA, so you may be able to convert your Hibernate code
> > to use one of these ORM interfaces.
> > -
>
> I'm using JPA with "Hibernate Entity Manager".   So, how can I
> configure App Engine to use my existing JPA backend on a Postgresql
> database?  I'm even willing to change the JPA persistence provider
> from "Hibernate Entity Manager" implementation to the Data Nucleus JPA
> implementation but I'm struggling to get the this configured
> properly.  Are there any example of folks configuring alternative
> databases with  JPA?   The documentation I've read so far seems to
> assume (or perhaps dictate) that I'm going to use JDO with Data
> Nucleus.
>
> I just want to get this data storage situation resolved as quickly as
> possible so I can get back to working on a AJAX front end.  Currently,
> I don't even plan on marshaling any of my POJOs the client.  My AJAX
> client will just use XML to communicate with my servlets.- Hide quoted text -
>
> - Show quoted text -


Additional reading and fumbling around has got me believing my
persistence.xml should more like this (note I changed the provider
classname based on documentation you referred me to --- thanks).


 
org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider

  
  
  
  
  

 

but now I think I need to round-up a datanucleus-rdbms jar but I'm not
sure which release is most compatible with the app-engine pieces I've
already downloaded via the gwt appengine eclipse plugin.  I using
postgresql 8.3 if that at all matters.  Am I on the right track here?
Any suggestions regarding  datanucleus-rdbms  versions?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-14 Thread jeremy rose



On Sep 14, 6:06 am, leszek  wrote:
> Hibernate is not JPA implementation, it exposes its own API.
> "Hibernate Entity Manager" is a product build on standard Hibernate
> and offering full JPA interface.
>
> Google App Engine does not support 
> Hibernate:http://groups.google.com/group/google-appengine-java/web/will-it-play...
> -
> Hibernate
> Versions: All
> Status: INCOMPATIBLE
>
>     * You cannot currently use Hibernate directly. The differences
> between the App Engine datastore and SQL were too great to get the
> standard Hibernate up and running under App Engine. App Engine does
> support JDO and JPA, so you may be able to convert your Hibernate code
> to use one of these ORM interfaces.
> -

I'm using JPA with "Hibernate Entity Manager".   So, how can I
configure App Engine to use my existing JPA backend on a Postgresql
database?  I'm even willing to change the JPA persistence provider
from "Hibernate Entity Manager" implementation to the Data Nucleus JPA
implementation but I'm struggling to get the this configured
properly.  Are there any example of folks configuring alternative
databases with  JPA?   The documentation I've read so far seems to
assume (or perhaps dictate) that I'm going to use JDO with Data
Nucleus.

I just want to get this data storage situation resolved as quickly as
possible so I can get back to working on a AJAX front end.  Currently,
I don't even plan on marshaling any of my POJOs the client.  My AJAX
client will just use XML to communicate with my servlets.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-14 Thread jeremy rose



On Sep 13, 10:06 pm, datanucleus  wrote:
> > I've discovered if I changed the datanucleus.ConnectionURL to
> > "appengine" I was able to get further
>
> You mean like the GAE/J documentation defines for you to do? and also
> the DataNucleus 
> docshttp://www.datanucleus.org/products/accessplatform_1_1/appengine/supp...
>
> > This persistence provider doesn't seem to
> > allow a method such as isAgitated() to be in a entity class even if
>
> What method "isAgitated" ? There is nothing in the JPA spec with such
> a name. This is nothing to do with the persistence provider
>
> DataNucleus is a fully compliant JPA implementation for RDBMS. It is
> also a JPA implementation for XML, LDAP, OODBMS, GAE/J, HBase, ODF,
> and more. It has all features of JPA that are to be found in other
> implementations. Hibernate is an implementation of JPA for RDBMS, and
> nothing else (hence since you aren't using an RDBMS here I fail to see
> the way you can apply it to your problem with GAE/J)
>
> Please specify which exact JPA behaviour causes "headache"
>
> --Andy (DataNucleus)

I guess the "headache" is that I had a backend server piece using JPA
(Hibernate implementation) with a Postgresql database working just
fine.   Now that I want to use the GWT toolkit to develop some AJAX
front-end capabiltiy, I having to go back and revisit my server-side
data storage.  I expected the AJAX develop tools to allow me to keep
these two concerns (AJAX UI and backend storage) somewhat separate.
I'm not opposed to using Data Nucleus since it implements JPA (what
I've already coded to) but I'm still having a devil of a time figuring
out how to configure it to work with may existing annotated POJOs and
my exising Postgresql database.   All the documentation seems to
assume (or perhaps dictate) that I going to use the preconfigured Data
Nucleus "appengine" with JDO.

My specific issues are:
1) I put a convenience method in  a POJO named "isInProximity
(aPeerPojo)" and even though is also takes a parameter and has an
@Transient annotation, I get errors about having declared an
"InProximity" field in MetaData but this field doesn't exist.  If I
rename the method to not start with "is" this error goes away.

2) I'm getting errors with my @GeneratedValue
(strategy=GenerationType.SEQUENCE ...).  I believe this is because its
using a database that has a different strategy for creating object
identifiers.   That is, is not using my Postgresql database but using
some appengine database instead.   So, I'm still struggling to get all
the configuration setup so it will just work with the backend
datastorage mechanism I had working before I downloaded the eclipse
plugins to develop some AJAX frontends.

I'd even consider migrating from Postgresql if I had a better idea of
just how much work is involved and how this "appengine" database will
perform once it has tens of gigabytes of data in it (as long as I can
still use JPA).   I really just want to get this data storage issue
reconciled as quickly as possible so I can get back to developing AJAX
frontends.  As I mentioned previously, I don't currently plan to
mashal any of these database POJOs to the client.   I'm planning to
just use XML for client/server communication.

Jeremy
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-13 Thread jeremy rose



On Sep 13, 6:30 pm, jeremy rose  wrote:
> I have a JPA application that works fine with Hibernate as the
> persistence provider.  Now, I'm trying to use the gwt with eclipse to
> develop an AJAX client for it.  I do not intend to marshal my
> persistent objects to the client but to simply have the client
> communicate with my server via XML.  However, my RemoteServiceServlet
> runs up against Data Nucleus when I tries to use JPA.  Apparently
> things have been already configured to use Data Nucleus as a JDO
> provider (and I have no knowledge or experience with either one of
> these).
>
> When I started reading the Data Nucleus documentation, I was happy to
> discover it is a JPA provider in addition to a JDO provider.  So, my
> first thought is it just change the configuration to use it as the JPA
> provider instead of Hibernate.   But I'm still struggling to get
> things configured properly and am wondering if I can just by-pass Data
> Nucleus altogether and go back to using Hibernate.  I have a
> Postgresql database with the schema already setup.   My
> persistance.xml file is:
>
> 
> http://java.sun.com/xml/ns/persistence";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>                      
> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";
>     version="1.0">
>
>   
>     org.datanucleus.jpa.PersistenceProviderImpl
>     
>                       value="org.postgresql.Driver"/>
>                       value="jdbc:postgresql://localhost:5432/
> myapplicationdatabasename"/>
>        value="myusername"/>
>        value="myuserpassword"/>
>     
>   
> 
>
> My servlet gets the following exception:
>
> Caused by: org.datanucleus.exceptions.NucleusUserException: No
> available StoreManager found for the datastore URL key "jdbc". Please
> make sure you have all relevant plugins in the CLASSPATH (e.g
> datanucleus-rdbms?, datanucleus-db4o?), and consider setting the
> persistence property "datanucleus.storeManagerType" to the type of
> store you are using e.g rdbms, db4o
>         at org.datanucleus.store.FederationManager.initialiseStoreManager
> (FederationManager.java:197)
>         at org.datanucleus.store.FederationManager.
> (FederationManager.java:70)
>         at org.datanucleus.ObjectManagerFactoryImpl.initialiseStoreManager
> (ObjectManagerFactoryImpl.java:153)
>         at
> org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration
> (JDOPersistenceManagerFactory.java:526)
>
> Obviously, Data Nucleus needs more or different configuration than
> what I have provided but I'm still reading and hacking and failing to
> figure this out.   Any suggestions would be greatly appreciated.
>
> Jeremy

I've discovered if I changed the datanucleus.ConnectionURL to
"appengine" I was able to get further but its still an ongoing set of
hassles and headaches.   This persistence provider doesn't seem to
allow a method such as isAgitated() to be in a entity class even if
the method is tagged with a @Transient annotation to indicate there is
no property to persist.  After renaming the method, the next hurdle is
there is no ID value generator for the strategy of sequence for
whatever datastore I am using now.   I guess I can go change my ID
generation strategies but I was hoping to use the GWT for developing
AJAX applications without having to over the datastore decisions to
it.   Fundamentally, it seems like these two concerns (AJAX
presentation and backend data storage) should be separable. So the
question remains, can I use GWT with JPA without using Data Nucleas?

Jeremy
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Can I avoid Data Nucleus and still use JPA?

2009-09-13 Thread jeremy rose

I have a JPA application that works fine with Hibernate as the
persistence provider.  Now, I'm trying to use the gwt with eclipse to
develop an AJAX client for it.  I do not intend to marshal my
persistent objects to the client but to simply have the client
communicate with my server via XML.  However, my RemoteServiceServlet
runs up against Data Nucleus when I tries to use JPA.  Apparently
things have been already configured to use Data Nucleus as a JDO
provider (and I have no knowledge or experience with either one of
these).

When I started reading the Data Nucleus documentation, I was happy to
discover it is a JPA provider in addition to a JDO provider.  So, my
first thought is it just change the configuration to use it as the JPA
provider instead of Hibernate.   But I'm still struggling to get
things configured properly and am wondering if I can just by-pass Data
Nucleus altogether and go back to using Hibernate.  I have a
Postgresql database with the schema already setup.   My
persistance.xml file is:


http://java.sun.com/xml/ns/persistence";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";
version="1.0">

  
org.datanucleus.jpa.PersistenceProviderImpl

  
  
  
  

  


My servlet gets the following exception:

Caused by: org.datanucleus.exceptions.NucleusUserException: No
available StoreManager found for the datastore URL key "jdbc". Please
make sure you have all relevant plugins in the CLASSPATH (e.g
datanucleus-rdbms?, datanucleus-db4o?), and consider setting the
persistence property "datanucleus.storeManagerType" to the type of
store you are using e.g rdbms, db4o
at org.datanucleus.store.FederationManager.initialiseStoreManager
(FederationManager.java:197)
at org.datanucleus.store.FederationManager.
(FederationManager.java:70)
at org.datanucleus.ObjectManagerFactoryImpl.initialiseStoreManager
(ObjectManagerFactoryImpl.java:153)
at
org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration
(JDOPersistenceManagerFactory.java:526)

Obviously, Data Nucleus needs more or different configuration than
what I have provided but I'm still reading and hacking and failing to
figure this out.   Any suggestions would be greatly appreciated.

Jeremy


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---