Package com.google.appengine.api.datastore

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


                DatastoreUtil.delete(ds, tx, key);
                tx.commit();
            }
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
    }

    /**
 
View Full Code Here


            DatastoreUtil.put(ds, tx, toEntity());
            tx.commit();
            return;
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
    }

    /**
 
View Full Code Here

            DatastoreUtil.put(ds, tx, toEntity());
            tx.commit();
            return map;
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
    }

    /**
 
View Full Code Here

            tx.commit();
        } catch (ConcurrentModificationException e) {
            throw createConcurrentModificationException(rootKey, e);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
    }

    /**
 
View Full Code Here

    } else {
      // ordinarily the txn gets aborted in DatastoreXAResource.commit(), but
      // if the begin/abort block doesn't perform any reads or writes then
      // DatastoreXAResource.rollback() won't be called.  In order to avoid
      // leaving transactions open we do the rollback here.
      txn.rollback();
    }
  }
}
View Full Code Here

    } else {
      // ordinarily the txn gets aborted in DatastoreXAResource.commit(), but
      // if the begin/abort block doesn't perform any reads or writes then
      // DatastoreXAResource.rollback() won't be called.  In order to avoid
      // leaving transactions open we do the rollback here.
      txn.rollback();
    }
  }
}
View Full Code Here

      ent2.setProperty("foo", "changed");
      cacheds.put(txn, ent2);
      txn.commit();
    } finally {
      if (txn.isActive())
        txn.rollback();
    }

    Entity ent3 = cacheds.get(childKey);

    assert "changed".equals(ent3.getProperty("foo"));
View Full Code Here

      Map<Object, Object> fetched = cs1.getAll((Collection)Collections.singleton(childKey));
      Entity ent3 = (Entity)fetched.get(childKey);
      assert ent3.getProperty("foo").equals("changed");
    } finally {
      if (txn.isActive())
        txn.rollback();
    }
  }

  /** */
  @Test
 
View Full Code Here

          try {
            work.getWorkDelegate(getVisitor()).performWork(work, indexWriter, monitor);
            transaction.commit();
          } finally {
            if (transaction.isActive())
              transaction.rollback();
          }

          if (LOG.isLoggable(Level.INFO)) {
            String entity = work.getEntityClass().toString();
            LOG.info("Performed lucene work for " + entity + " in " + (System.currentTimeMillis() - time) + " ms");
View Full Code Here

                .match(meta.modelToEntity(minutes), "HotMinutes");
            Datastore.put(tx, minutes);
            tx.commit();
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
        }
        Memcache.delete(MEMCACHE_KEY_LIST);
    }
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.