Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Transaction.rollback()


      encodedKey = KeyFactory.keyToString(key);
      Datastore.logger.fine("MessageDescriptor key: " + encodedKey);
      txn.commit();
    } finally {
      if (txn.isActive()) {
        txn.rollback();
      }
    }
    return encodedKey;
  }
View Full Code Here


    } catch (EntityNotFoundException e) {
      Datastore.logger.severe("No entity for key " + key);
      return null;
    } finally {
      if (txn.isActive()) {
        txn.rollback();
      }
    }
  }

  public static String createMessageDescriptor(MessageDescriptor descriptor) {
View Full Code Here

      encodedKey = KeyFactory.keyToString(key);
      Datastore.logger.fine("MessageDescriptor key: " + encodedKey);
      txn.commit();
    } finally {
      if (txn.isActive()) {
        txn.rollback();
      }
    }
    return encodedKey;
  }
View Full Code Here

          // Now we need to roll back the transaction (even though it doesn't
          // actually exist), otherwise TransactionCleanupFilter will try to
          // roll it back, which is bad because it's not prepared for the crash
          // that we catch below.
          try {
            rawTransaction.rollback();
            throw new Error("Rollback of nonexistent transaction did not fail");
          } catch (DatastoreTimeoutException e2) {
            log.log(Level.INFO, "Rollback of nonexistent transaction failed as expected", e2);
          }
          throw e;
View Full Code Here

        }
      }
      transaction.commit();
    } finally {
      if (transaction.isActive()) {
        transaction.rollback();
      }
    }
  }

  private abstract class Operation {
View Full Code Here

    Transaction transaction = dataStore.beginTransaction();
    try {
      return queryEntity(key);
    } finally {
      if (transaction.isActive()) {
        transaction.rollback();
      }
    }
  }

  @SuppressWarnings("unused")
View Full Code Here

    Transaction transaction = dataStore.beginTransaction();
    try {
      return dataStore.get(keys);
    } finally {
      if (transaction.isActive()) {
        transaction.rollback();
      }
    }
  }

  @Override
View Full Code Here

        scheduleControllerTask(tx, jobState);
      }
      tx.commit();
    } finally {
      if (tx.isActive()) {
        tx.rollback();
      }
    }
  }

  void runTask(String taskId, String jobId, int sequenceNumber) {
View Full Code Here

        scheduleWorkerTask(tx, jobState.getSettings(), taskState);
      }
      tx.commit();
    } finally {
      if (tx.isActive()) {
        tx.rollback();
      }
    }
  }

  private String getTaskId(String jobId, int taskNumber) {
View Full Code Here

        DATASTORE.put(tx, IncrementalTaskState.Serializer.toEntity(taskState));
        scheduleWorkerTask(tx, settings, taskState);
        tx.commit();
      } finally {
        if (tx.isActive()) {
          tx.rollback();
        }
      }
    }
  }
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.