Skip to content

Instantly share code, notes, and snippets.

@ashigeru
Created April 27, 2010 11:28
Show Gist options
  • Save ashigeru/380638 to your computer and use it in GitHub Desktop.
Save ashigeru/380638 to your computer and use it in GitHub Desktop.
package slim3.controller;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Transaction;
public class HelloController extends Controller {
@Override
public Navigation run() throws Exception {
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();
}
return forward("Hello.jsp");
}
}
@ashigeru
Copy link
Author

App Engine SDK: 1.3.2
Slim3: 1.0.2
Production

@ashigeru
Copy link
Author

DatastoreUtil.put のなかでPb触ってる感じ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment