UserImpl user = ofyTxn.get(UserImpl.class, userId);
user.editFrom(updatedUser);
ofyTxn.put(user);
ofyTxn.getTxn().commit();
} catch (NotFoundException e) {
throw new ObjectNotFoundException("User not found, can't modify. Id = " + userId);
} finally {
if (ofyTxn.getTxn().isActive()) {
ofyTxn.getTxn().rollback();
}
}