Created
April 27, 2010 11:28
-
-
Save ashigeru/380638 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} |
DatastoreUtil.put のなかでPb触ってる感じ
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
App Engine SDK: 1.3.2
Slim3: 1.0.2
Production