Package com.google.appengine.api.datastore

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


      Key contactKey) {
    Entity e = new Entity("Contact Entry", getCacheEntity(uco).getKey());
    e.setProperty("contactKey", contactKey);
    Transaction txn = datastore.beginTransaction();
    datastore.put(e);
    txn.commit();
    return e;
  }

  private List<Entity> getContactEntryEntityList(Key cacheKey) {
    Query q = new Query("Contact Entry");
View Full Code Here


    e.setProperty("phoneNumber", cio.getPhoneNumber());
    e.setProperty("seatConfig", cio.getSeatConfig());
    e.setProperty("notifyConfig", cio.getNotifyConfig());
    e.setProperty("carrier", cio.getCarrier().getGateway());
    datastore.put(e);
    txn.commit();
    return e;
  }

  private void destroyContactInformationEntity(Key contactKey) {
    Transaction txn = datastore.beginTransaction();
View Full Code Here

  }

  private void destroyContactInformationEntity(Key contactKey) {
    Transaction txn = datastore.beginTransaction();
    datastore.delete(contactKey);
    txn.commit();
  }

  private Entity createUniqueCourseEntity(UniqueCourseObject uco) {

    Transaction txn = datastore.beginTransaction();
View Full Code Here

    Entity e = new Entity("Unique Course", k);
    e.setProperty("departmentName", uco.getDepartmentName());
    e.setProperty("courseNumber", uco.getCourseNumber());
    e.setProperty("sectionNumber", uco.getSectionNumber());
    datastore.put(e);
    txn.commit();
    return e;
  }

  private void destroyUniqueCourseEntity(Key courseKey) {
    Transaction txn = datastore.beginTransaction();
View Full Code Here

  }

  private void destroyUniqueCourseEntity(Key courseKey) {
    Transaction txn = datastore.beginTransaction();
    datastore.delete(courseKey);
    txn.commit();
  }

  private Entity getCacheEntity(UniqueCourseObject uco) {
    Query q = new Query("Cache");
    q.addFilter("courseKey", Query.FilterOperator.EQUAL,
View Full Code Here

      for (CompressionType compression : compressionTypes) {
        Transaction tx = datastore.beginTransaction();
        Entity entity = new Entity(key);
        SerializationUtil.serializeToDatastoreProperty(tx, entity, "foo", original, compression);
        datastore.put(entity);
        tx.commit();
        entity = datastore.get(key);
        Serializable restored = SerializationUtil.deserializeFromDatastoreProperty(entity, "foo");
        assertEquals(original, restored);
      }
    }
View Full Code Here

    {
      Key key = entity.getKey();
      Transaction txn = datastore.beginTransaction();
      try {
        key = datastore.put(entity);
        txn.commit();
      } finally {
        if (txn.isActive())
          txn.rollback();
        else {
          addToCache(key, entity);
View Full Code Here

//tx.begin();
       datastore.put(e);

         long k = e.getKey().getId();
trans.commit();
suc = true;
return k;
   } finally {
 
    //if (tx.isActive())
View Full Code Here

   
           checkThread();

         Key key = KeyFactory.createKey(pk,kind,id);
                datastore.delete(key);
trans.commit();
    suc = true;
                    return;
 
 
 
View Full Code Here

    public Tweet tweet(Map<String, Object> input) {
        Tweet tweet = new Tweet();
        BeanUtil.copy(input, tweet);
        Transaction tx = Datastore.beginTransaction();
        Datastore.put(tx, tweet);
        tx.commit();
        return tweet;
    }

    public Tweet getTweet(Key key, Long version) {
        return Datastore.get(t, key, version);
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.