Package javax.jdo.datastore

Examples of javax.jdo.datastore.Sequence.allocate()


    for (int i  = 0; i< COMPARE_NUMBER; i++) {
      s.next();
    }
    timeToGetManyNext = System.currentTimeMillis() - timeToGetManyNext;
    long timeToGetManyAllocate = System.currentTimeMillis();
    s.allocate(COMPARE_NUMBER);
    for (int i  = 0; i< COMPARE_NUMBER; i++) {
      s.next();
    }
    timeToGetManyAllocate = System.currentTimeMillis() - timeToGetManyAllocate;
    logger.log(BasicLevel.DEBUG, COMPARE_NUMBER + " ids generated:\nwith allocate: " + timeToGetManyAllocate
View Full Code Here


      assertNotNull("Sequence " + PHONE_SEQ + " should not be null.", s);
      Phone[] phones = new Phone[ADDITIONAL];
      long timeAllocate = System.currentTimeMillis();
      pm.currentTransaction().begin();
      //allocate
      s.allocate(ADDITIONAL);
      for (int i = 0; i < ADDITIONAL ; i++) {
        phones[i] = new Phone();
        phones[i].setName("phone " + i);
      }
      //make persistent
View Full Code Here

    try {
      pm.getObjectIdClass(Article.class);
      //  get the sequence
      Sequence s = pm.getSequence(ARTICLE_SEQ);
      assertNotNull("Sequence " + ARTICLE_SEQ + " should not be null.", s);
      s.allocate(ADDITIONAL);
      Article articles[] = new Article[ADDITIONAL];
      for (int i = 0; i < ADDITIONAL; i++) {
        if (i%2 == 0) {
          articles[i] = new Service();
        } else {
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.