Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,17 @@ public void testLookup() {
public void testUpdate() {
datastore.put(testEntity);
// [START datastore_update]
Entity task = Entity.newBuilder(datastore.get(taskKey)).set("priority", 5).build();
datastore.update(task);
Entity task;
Transaction txn = datastore.newTransaction();
try {
task = Entity.newBuilder(txn.get(taskKey)).set("priority", 5).build();
txn.put(task);
txn.commit();
} finally {
if (txn.isActive()) {
txn.rollback();
}
}
// [END datastore_update]
assertEquals(task, datastore.get(taskKey));
}
Expand Down
Loading