google-code-export / slim3

Automatically exported from code.google.com/p/slim3
1 stars 1 forks source link

Transaction sometimes does not work #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

The following code sometimes fails.

Entity entity = new Entity("Test", "k");
Datastore.put(entity);

Transaction tx = Datastore.beginTransaction();
entity.setProperty("p", 0);
Datastore.put(tx, entity);
Datastore.rollback(tx);

if (Datastore.get(entity.getKey()).getProperty("p") != null) {
    throw new IllegalStateException();
}

The cause is DatastoreUtil#createPutRequest().
DatastoreUtil#createPutRequest() assumes that transaction handle is
positive. But in fact, there are the cases transaction handle is negative.

Original issue reported on code.google.com by higaya...@gmail.com on 28 Apr 2010 at 1:40

GoogleCodeExporter commented 9 years ago

Original comment by higaya...@gmail.com on 28 Apr 2010 at 2:17