Package com.google.appengine.api.datastore

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


    // does nothing
  }

  public void commitTransaction() {
    Transaction txn = ds.getCurrentTransaction();
    txn.commit();
  }

  public void rollbackTransaction() {
    Transaction txn = ds.getCurrentTransaction();
    txn.rollback();
View Full Code Here


                // highest parent node)
    Transaction txn = datastore.beginTransaction();
    Entity e = new Entity(DATASTORE_ENTITY_SET_NAME,
        DATASTORE_ENTITY_KEY_NAME);
    datastore.put(e);
    txn.commit();
  }

  public void traceSchema() {
    Query q = new Query();
    Key k = KeyFactory.createKey(DATASTORE_ENTITY_SET_NAME,
View Full Code Here

                                      // all
                                      // properties
      e.setProperty(SUBJECT_TITLE_PROPERTY, dio.getSubjectTitle());
      e.setProperty(FACULTY_PROPERTY, dio.getFaculty());
      datastore.put(e); // put the entity in the datastore
      txn.commit(); // commit
      return true;
    }
    return false;
  }
View Full Code Here

      e.setProperty(COURSE_TITLE_PROPERTY, cio.getCourseTitle());
      e.setProperty(PREREQ_PROPERTY, cio.getPrereqString());
      e.setProperty(COREQ_PROPERTY, cio.getCoreqString());
      e.setProperty(CREDIT_PROPERTY, cio.getCredits());
      datastore.put(e);
      txn.commit();
      return true;
    }
    return false;
  }
View Full Code Here

      e.setProperty(ROOM_PROPERTY, sio.getRoom());
      e.setProperty(CDF_PROPERTY, sio.isCdf());
      e.setProperty(DROP_NO_W_PROPERTY, sio.getDropNoWDate());
      e.setProperty(DROP_W_PROPERTY, sio.getDropWDate());
      datastore.put(e);
      txn.commit();
      System.out.println("Added section: " + sio.getSectionId());
      return true;
    }
    return false;
  }
View Full Code Here

      e.setProperty(BOOK_TITLE_PROPERTY, bio.getTitle());
      e.setProperty(BOOK_REQUIRED_PROPERTY, bio.getRequired());
      e.setProperty(BOOK_AUTHOR_PROPERTY, bio.getAuthor());
      e.setProperty(BOOK_ISBN_PROPERTY, bio.getIsbn());
      datastore.put(e);
      txn.commit();
      return true;
    }
    return false;
  }
View Full Code Here

    q.setKeysOnly();
    if(datastore.prepare(q).asSingleEntity() == null) {
      Transaction txn = datastore.beginTransaction();   
      Entity e = new Entity(DATASTORE_ENTITY_SET_NAME, DATASTORE_ENTITY_KEY_NAME);
      datastore.put(e);
      txn.commit();
    }
  }
 
  public static String addNotifier(String email, String pNum, String dept, String course, String section){
    String verifyKey = generateVerificationKey();
View Full Code Here

    e.setProperty(PHONE_NUMBER_PROPERTY, pNum);
    e.setProperty(DEPT_PROPERTY, dept);
    e.setProperty(COURSE_PROPERTY, course);
    e.setProperty(SECTION_PROPERTY, section);
    datastore.put(e);                                                             
    txn.commit();
    return verifyKey;
  }
 
  private static String generateVerificationKey(){
    MessageDigest m;
View Full Code Here

    q.setKeysOnly();
    if(datastore.prepare(q).asSingleEntity() == null) {
      Transaction txn = datastore.beginTransaction();   
      Entity e = new Entity(DATASTORE_ENTITY_SET_NAME, DATASTORE_ENTITY_KEY_NAME);
      datastore.put(e);
      txn.commit();
    }
  }

 
  public void traceSchema() {
View Full Code Here

      e.setProperty(AUTHENTICATION_KEY_PROPERTY, ao.getAuthkey());
      e.setProperty(PREFERENCE_NOTIFY_CONFIG_PROPERTY, ao.getNotifyConfig());
      e.setProperty(PREFERENCE_PHONE_NUMBER_PROPERTY, ao.getPhoneNumber());
      e.setProperty(PREFERENCE_CARRIER_PROPERTY, ao.getCarrier().getGateway());
      datastore.put(e);                                                             
      txn.commit();                                                                 
      return true;
    }
    return false;
  }
 
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.