I'm starting a project and I will use JPA. Some architecture design
decisions must take into account the datastore limitations.

"All datastore operations in a transaction must operate on entities in
the same entity group. This includes querying for entities by
ancestor, retrieving entities by key, updating entities, and deleting
entities. Notice that each root entity belongs to a separate entity
group, so a single transaction cannot create or operate on more than
one root entity."
(http://code.google.com/appengine/docs/java/datastore/
transactions.html#What_Can_Be_Done_In_a_Transaction)

In order to understand the datastore behavior I wrote some junit tests
in JPA and JDO. I discovered that the behavior is not the same,
probably due to some configuration that I didn't made correctly. For
instance if you look at the test
"testNoTransactionCreateEntitiesInDifferentEntityGroups", I will work
in JDO, but fail in JPA !?!
I think it should work in JPA too.

My problem is the following, I think I can live with the restriction
of not performing a transaction across entity groups. However I willI
need to read a bunch of records that are in different entity groups
during the transaction (I will not change them). Today it is possible,
according to the test "testChangesOnePersistOneEntityGroups_Tx" but
will work forever, or it just works because of a bug?

For instance if I decide to store each Student in a different entity
group, will I be able to perform a query to search for a student with
that has some properties, since each one potentially resides in a
different "distributed network"?

I case it is relevant, I performed the tests in the following
environment:
    Suse 11.2 - 64 bits
    JDK 1.6.0_18
    GAE SDK 1.3.2

The test suites can be downloaded here:
http://dl.dropbox.com/u/608190/gae/simpleDatastore_TestSuite.zip

Regards
António Casqueiro

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to