自从上周初公认会计原则进入定价模式以来,我一直在追捕超过我对数据库阅读和书写业务的配额。 我不相信谷歌是否把所有最新情况都算作一字,也不确定每栏更新是否算作单独的书写。
如果后者是真的,我能否通过一个更新职能来更新参数中的6栏,或者我是否也为6项更新收取费用?
Here is my existing code, used to update a player s score (rating) and the other details at the same time. At the moment I always populate name, email, rating, won, played and achievements with values from the client. One solution may be to only send these from the client side when they have changed value.
Long key = Long.valueOf(updateIdStr);
System.out.println("Key to update: " + key);
PlayerPersistentData ppd =null;
try {
ppd = pm.getObjectById(
PlayerPersistentData.class, key);
// for all of these, make sure we actually got a value via
// the query variables
if (name != null && name.length() > 0) {
ppd.setName(name);
}
if (ratingStr != null && ratingStr.length() > 0) {
ppd.setRating(rating);
}
if (playedStr != null && playedStr.length() > 0) {
ppd.setPlayed(played);
}
if (wonStr != null && wonStr.length() > 0) {
ppd.setWon(won);
}
if (encryptedAchievements != null
&& encryptedAchievements.length() > 0) {
ppd.setAchievements(achievements);
}
if (email != null & email.length() > 0) {
ppd.setEmail(email);
}
resp.getWriter().print(key);
} catch (JDOObjectNotFoundException e) {
resp.getWriter().print(-1);
}
}