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

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


      Assert.check(metadata.hasUdwMetadata(), "Metadata not udw: %s, %s", udwId, metadataString);
      convId = new SlobId(metadata.getUdwMetadata().getAssociatedConvId());
      udwOwner = new StableUserId(metadata.getUdwMetadata().getOwner());
      raw = l.reconstruct(null);
    } finally {
      tx.rollback();
    }
    WaveletName waveletName = IdHack.udwWaveletNameFromConvObjectIdAndUdwObjectId(convId, udwId);
    // TODO(ohler): avoid serialization/deserialization here
    WaveletDataImpl waveletData = deserializeWavelet(waveletName, raw.getState().snapshot());
    Assert.check(raw.getVersion() == waveletData.getVersion(),
View Full Code Here


        throw new WaveletLockedException("Conv " + id + " locked: " + metadata);
      }
      MutationLog l = convStore.create(tx, id);
      raw = l.reconstruct(null);
    } finally {
      tx.rollback();
    }
    WaveletName waveletName = IdHack.convWaveletNameFromConvObjectId(id);
    // TODO(ohler): avoid serialization/deserialization here
    WaveletDataImpl waveletData = deserializeWavelet(waveletName,
        raw.getState().snapshot());
View Full Code Here

    CheckedTransaction tx = datastore.beginTransaction();
    try {
      MutationLog l = udwStore.create(tx, udwId);
      raw = l.reconstruct(null);
    } finally {
      tx.rollback();
    }
    WaveletName waveletName = IdHack.udwWaveletNameFromConvObjectIdAndUdwObjectId(convId, udwId);
    // TODO(ohler): avoid serialization/deserialization here
    WaveletDataImpl waveletData = deserializeWavelet(waveletName,
        raw.getState().snapshot());
View Full Code Here

              try {
                List<ImportTask> tasksInProgress = perUserTable.get().getAllTasks(tx, userId);
                return Pair.of(describeTasks(tasksInProgress),
                    getWaves(tx, taskDispatcher.waveletImportsInProgress(tasksInProgress)));
              } finally {
                tx.rollback();
              }
            }
          });
    } catch (PermanentFailure e) {
      throw new IOException("PermanentFailure retrieving import records", e);
View Full Code Here

            try {
              Entity entity = tx.get(makeKey(userId));
              log.info("Got " + (entity == null ? null : entity.getKey()));
              return entity;
            } finally {
              tx.rollback();
            }
          }
        });
    Record read = convertEntity(e);
    memcache.putIfUntouched(userId, cached, read);
View Full Code Here

      throws PermanentFailure, RetryableFailure {
    CheckedTransaction tx = store.beginTransaction();
    try {
      return tx.get(key);
    } finally {
      tx.rollback();
    }
  }

}
View Full Code Here

    try {
      CheckedTransaction tx = datastore.beginTransaction();
      try {
        return perUserTable.getTask(tx, userId, taskId);
      } finally {
        tx.rollback();
      }
    } catch (RetryableFailure e) {
      // If we can't even read the task, let the task queue retry rather than
      // doing it here.  Seems better because it means we don't use waste a
      // thread for waiting.
View Full Code Here

    try {
      CheckedTransaction tx = datastore.beginTransaction();
      try {
        return get(tx, id);
      } finally {
        tx.rollback();
      }
    } catch (PermanentFailure e) {
      log.log(Level.SEVERE, "Failed to look up " + id, e);
      throw new IOException(e);
    } catch (RetryableFailure e) {
View Full Code Here

          if (version == 0) {
            throw new SlobNotFoundException(
                "Slob " + slobId + " (" + rootEntityKind + ") not found");
          }
        } finally {
          tx.rollback();
        }
      } catch (PermanentFailure e) {
        throw new IOException(e);
      } catch (RetryableFailure e) {
        throw new IOException(e);
View Full Code Here

      CheckedTransaction tx = datastore.beginTransaction();
      try {
        MutationLog l = mutationLogFactory.create(tx, slobId);
        return l.reconstruct(version).getState().snapshot();
      } finally {
        tx.rollback();
      }
    } catch (PermanentFailure e) {
      throw new IOException(e);
    } catch (RetryableFailure e) {
      throw new IOException(e);
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.