Package com.google.walkaround.util.server.appengine.CheckedDatastore

Examples of com.google.walkaround.util.server.appengine.CheckedDatastore.CheckedTransaction.commit()


        public void run() throws RetryableFailure, PermanentFailure {
          CheckedTransaction tx = datastore.beginTransaction();
          tx.put(new Entity(KeyFactory.createKey(
              MutationLog.makeRootEntityKey(rootEntityKind, slobId),
              syncEntityKind, SYNC_ENTITY_NAME)));
          tx.commit();
        }
      });
    } catch (PermanentFailure e) {
      throw new RuntimeException("Failed to touch sync entity, trying again later", e);
    }
View Full Code Here


            if (existing != null) {
              log.info("Read " + existing + " in " + tx);
              return parse(existing);
            } else {
              put(tx, newEntry);
              tx.commit();
              log.info("Committed " + tx);
              return null;
            }
          } finally {
            tx.close();
View Full Code Here

              try {
                convStore.newObject(tx, convId, makeObsoleteConvMetadata(), history,
                    inhibitPreAndPostCommit);
                convMetadataStore.put(tx, convId,
                    convMetadata != null ? convMetadata : new ConvMetadataGsonImpl());
                tx.commit();
              } catch (SlobAlreadyExistsException e) {
                throw new RetryableFailure("Slob id collision, retrying: " + convId, e);
              } catch (AccessDeniedException e) {
                throw new RuntimeException(
                    "Unexpected AccessDeniedException creating conv " + convId, e);
View Full Code Here

            @Override public SlobId run() throws RetryableFailure, PermanentFailure {
              SlobId udwId = getRandomObjectId();
              CheckedTransaction tx = datastore.beginTransaction();
              try {
                udwStore.newObject(tx, udwId, metadata, initialHistory, false);
                tx.commit();
              } catch (SlobAlreadyExistsException e) {
                throw new RetryableFailure("Slob id collision, retrying: " + udwId, e);
              } catch (AccessDeniedException e) {
                throw new RuntimeException(
                    "Unexpected AccessDeniedException creating udw " + udwId, e);
View Full Code Here

      new RetryHelper().run(new RetryHelper.VoidBody() {
        @Override public void run() throws RetryableFailure, PermanentFailure {
          CheckedTransaction tx = datastore.beginTransaction();
          try {
            put(tx, newEntry);
            tx.commit();
            log.info("Committed " + tx);
          } finally {
            tx.close();
          }
        }
View Full Code Here

              Secret newSecret = Secret.generate(random);
              Entity e = new Entity(SECRET_KEY);
              DatastoreUtil.setNonNullUnindexedProperty(e, SECRET_PROPERTY,
                  new Blob(newSecret.getBytes()));
              tx.put(e);
              tx.commit();
              log.info("Generated new secret");
              return newSecret;
            } finally {
              tx.close();
            }
View Full Code Here

          new RetryHelper.VoidBody() {
            @Override public void run() throws RetryableFailure, PermanentFailure {
              CheckedTransaction tx = datastore.beginTransaction();
              try {
                addToPerUserTable(tx, newId, isPrivate);
                tx.commit();
              } finally {
                tx.close();
              }
            }
          });
View Full Code Here

                // stuff here rather than just commit() is error-prone.
                convSlobFacilities.getLocalMutationProcessor().runPreCommit(tx, convId, appender);
                appender.finish();
                convSlobFacilities.getLocalMutationProcessor().schedulePostCommit(
                    tx, convId, appender);
                tx.commit();
              } finally {
                tx.close();
              }
            }
          });
View Full Code Here

                //
                // TODO(ohler): Decide what to do about pre-commit actions.  Maybe we should
                // run them here?
                convSlobFacilities.getPostCommitActionScheduler()
                    .unconditionallyScheduleTask(tx, newId);
                tx.commit();
                return false;
              } finally {
                tx.close();
              }
            }
View Full Code Here

                    appender.appendAll(buffer);
                  } catch (ChangeRejected e) {
                    return e;
                  }
                  appender.finish();
                  tx.commit();
                  return null;
                } finally {
                  tx.close();
                }
              }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.