Hi all,

As the following document(54p) says,
journal and last committed timestamp are co-located with a root entity
of an entity group.
http://snarfed.org/space/datastore_talk.html

But, an entity group that does not have a root entity seem to support
transaction.
How does it work?

I tried the following code on production server:

DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Key parentKey = KeyFactory.createKey("Parent", 1);
Key child1Key = KeyFactory.createKey(parentKey, "Child", 1);
Key child2Key = KeyFactory.createKey(parentKey, "Child", 2);

Transaction tx1 = ds.beginTransaction();
ds.put(tx1, new Entity(child1Key));

Transaction tx2 = ds.beginTransaction();
ds.put(tx2, new Entity(child2Key));

tx1.commit();
try {
    tx2.commit();
} catch (ConcurrentModificationException e) {
    System.out.println(
        "An entity group that does not have a root entity supports
transaction.");
}
try {
    ds.get(parentKey);
} catch (EntityNotFoundException e) {
    System.out.println("There is no root entity.");
}
ds.delete(child1Key);

App Engine SDK version:1.2.8

Thanks,

Yasuo Higa

--

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-j...@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.


Reply via email to