Google App Engine#
|Apache DB Home||Datanucleus Home||Java API||Comparing JDO/JPA|
Before you sing-up (agreements here), they require you have a mobile number:
To create applications with Google App Engine, you need a verification code. ....
The verification code will be sent to it via SMS. Note you will only need to verify your account once.
Install / Test#
- Install the Eclipse plugin
- sudo apt-get install libstdc++5
I registered my first app with the ID computerhok01, so you can access it at http://computerhok01.appspot.com
Compiling module nl.computerhok.gae.test1.GAEtest1 Compiling 5 permutations Permutation compile succeeded Linking into war Link succeeded Compilation succeeded -- 26.989s Creating staging directory Scanning for jsp files. Compiling jsp files. Compiling java files. Scanning files on local disk. Initiating update. Cloning 30 static files. Cloning 65 application files. Uploading 31 files. Uploaded 7 files. Uploaded 14 files. Uploaded 21 files. Uploaded 28 files. Deploying new version. Will check again in 1 seconds Will check again in 2 seconds Closing update: new version is ready to start serving. Uploading index definitions. Deployment completed successfully
Application life cycle management#
A very nice feature of GAE is the way they manage deployed applications.
If you deploy an application, you can assign a version number (in Eclipse), if you deploy a new version, both the old and the new applications are available.
You can manage these application versions on the GAE console (see Administration Versions).
So you can simultaneously access both applications, for example with the following urls :
Here's a screenshot of the Qouta details page:
Things noticed / experiences#
- HttpSessions should be enabled in appengine-web.xml, The implementation uses the App Engine datastore and memcache to store session data.
- make sure that all objects in the session are Serializable (test environment accepts it, but GAE not)
- changing names of classes/packages of objects that were in the session earlier will cause problems:
Oops, not supported, you even get a compile error in your workbench, so you don't get to know the hostname of the host your request was handled on.
If you start using log4j in your webapp (and you added a log4j.jar to war/WEB-INF/lib and to your project's build path), JDO enhance ant task fails with a NoClassDefFoundError. Few hits on Google on that, finally removed log4j all together and switched to Java util logging.
- The datastore does not support the SQL language, you can only use JDOQL, for example, this is not supported :
Query query = getPersistenceManager().newQuery(Query.SQL, queryString);
Only one property per query may have inequality filters (<=, >=, <, >).. So you cannot do something like :
SELECT * FROM Peuter where geslacht>'M' AND achternaam>'b'
Case insensitive queries ?
What happens if you first create some entities, and then you add additional persistent fields ("columns") to the class ?
Well, that's nice, that simply works, tested by adding an adres field :-)