click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject GAE: Click JPA demo
Date Sun, 05 Jul 2009 16:38:58 GMT
Here is a small demo running Click+JPA on GAE:

The source can be found here:

To access the EntityManager I've opted for a EntityManager per request pattern
by specifying a filter which binds the EntityManager to a ThreadLocal.

As to be expected there are a number of restrictions enforced by GAE. Be sure
to read the following docs:

They have a weird notion called Entity Groups which basically amounts to an
object graph. However one cannot operate on more than one root entity per transaction.

Thus one cannot do:

   EntityManager em = ...
   for(Customer customer : customer) {

GAE realizes that the above code snippet persists multiple root entities (Customers)
and throws an exception.

Instead one will have to start a new transaction for each root Entity.

Also from what I can gather it seems JDO is recommended instead of JPA. Probably
because there is no RDBMS backing the API.

All in all GAE seems interesting, but its definitely worth reading the docs and
get to grips with the limitations.


View raw message