mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 16:30:12 +02:00
Fix the shell to allow multiple mutation of the same entity
Because of the objectify cache, after the first "read, change, write" of the first mutation - the second mutation would "read" the original value, which would then fail to be written with the error "Entity changed since init()". This was specifically seen in the "UpdateRegistrarCommand", but likely affected other commands as well. Clearing the cache before each command solves this issue. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192328213
This commit is contained in:
parent
e0c32337fd
commit
3dfd141e0f
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,7 @@ import com.google.appengine.tools.remoteapi.RemoteApiInstaller;
|
|||
import com.google.appengine.tools.remoteapi.RemoteApiOptions;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.tools.Injector.injectReflectively;
|
||||
|
||||
import com.beust.jcommander.JCommander;
|
||||
|
@ -203,6 +204,9 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
|
|||
|
||||
// Ensure that all entity classes are loaded before command code runs.
|
||||
ObjectifyService.initOfy();
|
||||
// Make sure we start the command with a clean cache, so that any previous command won't
|
||||
// interfere with this one.
|
||||
ofy().clearSessionCache();
|
||||
|
||||
command.run();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue