return null;
}
Objectify ofyTxn = newOfyTransaction();
UserImpl user = null;
int retry = 0;
while (user == null && retry < MAX_RETRIES) {
try {
EmailToUser emailToUser = ofyTxn.get(EmailToUser.class, emailQuery);
ofyTxn.getTxn().commit();
user = ofy().get(emailToUser.getUserKey());
} catch (NotFoundException e) {
user = new UserImpl(emailQuery);
user.setLocale(locale);
ofy().put(user);
EmailToUser emailToUser = new EmailToUser(emailQuery, user.createKey());
ofyTxn.put(emailToUser);
ofyTxn.getTxn().commit();
} finally {
if (ofyTxn.getTxn().isActive()) {
ofyTxn.getTxn().rollback();