Package com.google.appengine.api.datastore

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


    }

    public void deleteTweet(Key key) {
        Transaction tx = Datastore.beginTransaction();
        Datastore.delete(tx, key);
        tx.commit();
    }
   
    public void delete(Key key, Long version) {
        Transaction tx = Datastore.beginTransaction();
        Tweet tweet = Datastore.get(tx, t, key, version);
View Full Code Here


   
    public void delete(Key key, Long version) {
        Transaction tx = Datastore.beginTransaction();
        Tweet tweet = Datastore.get(tx, t, key, version);
        Datastore.delete(tx, tweet.getKey());
        tx.commit();
    }

    public void updateTweet(Key key, String content) {
        Transaction tx = Datastore.beginTransaction();
        Tweet tweet = Datastore.get(Tweet.class, key);
View Full Code Here

    public void updateTweet(Key key, String content) {
        Transaction tx = Datastore.beginTransaction();
        Tweet tweet = Datastore.get(Tweet.class, key);
        tweet.setContent(content);
        Datastore.put(tx, tweet);
        tx.commit();
    }

    public void updateTweet(Key key, Long version, Map<String, Object> input) {
        // TODO Auto-generated method stub
        Transaction tx = Datastore.beginTransaction();
View Full Code Here

        // TODO Auto-generated method stub
        Transaction tx = Datastore.beginTransaction();
        Tweet tweet = Datastore.get(tx, t, key, version);
        BeanUtil.copy(input, tweet);
        Datastore.put(tx, tweet);
        tx.commit();
    }
}
View Full Code Here

        Transaction trans = JIQLGDataUtil.getTransaction();

        try{
       
        removeTableInfo(t,trans);
        trans.commit();
        }catch (Exception e){
          trans.rollback();
          throw new SQLException(e.toString());
        }     
View Full Code Here

    public void shouldWorkInsideRunningTransaction() {
        update("F1", false, null, null, null);
        final Transaction txn = datastoreService.beginTransaction();
        update("F3", false, null, null, txn);
        repository.getFeatureState(TestFeature.F1);
        txn.commit();
    }

    @Test
    public void testShouldSaveStateWithoutStrategyOrParameters() throws EntityNotFoundException {
        /*
 
View Full Code Here

     */
    protected void putInsideTransaction(final Entity featureEntity) {
        final Transaction txn = this.datastoreService.beginTransaction();
        try {
            this.datastoreService.put(txn, featureEntity);
            txn.commit();
        } finally {
            if (txn.isActive()) {
                txn.rollback();
            }
        }
View Full Code Here

    protected Entity getInsideTransaction(final Key key) throws EntityNotFoundException {
        final Transaction txn = this.datastoreService.beginTransaction();
        Entity featureEntity;
        try {
            featureEntity = this.datastoreService.get(txn, key);
            txn.commit();
        } finally {
            if (txn.isActive()) {
                txn.rollback();
            }
        }
View Full Code Here

        return;
      }
      entity = new Entity(DEVICE_TYPE);
      entity.setProperty(DEVICE_REG_ID_PROPERTY, regId);
      datastore.put(entity);
      txn.commit();
    } finally {
      if (txn.isActive()) {
        txn.rollback();
      }
    }
View Full Code Here

        logger.warning("Device " + regId + " already unregistered");
      } else {
        Key key = entity.getKey();
        datastore.delete(key);
      }
      txn.commit();
    } finally {
      if (txn.isActive()) {
        txn.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.