Package com.google.appengine.api.datastore

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


                        // 登録画面を表示
                        return forward("/user/regist.jsp");
                    }
                   
                    Datastore.put(user);
                    tx.commit();
                    // 登録終了画面(完了画面ではない)を表示
                    return redirect("/user/");
                } else {
                    return forward("/user/regist.jsp");
                }
View Full Code Here


        assertThat(user.getInitialKey(), not(""));

        Editor stored = Datastore.getOrNull(Editor.class, user.getUid());
        assertThat(stored, is(nullValue()));

        tx.commit();
        stored = Datastore.getOrNull(Editor.class, user.getUid());
        assertThat(stored, instanceOf(Editor.class));
        assertThat(stored.getName(), is(name));
        assertThat(stored.getMail().getEmail(), is(mail));
        assertThat(stored.getRegisteredDate(), is(stored.getUpdatedDate()));
View Full Code Here

        assertThat(user.getInitialKey(), not(""));

        Administrator stored = Datastore.getOrNull(Administrator.class, user.getUid());
        assertThat(stored, is(nullValue()));

        tx.commit();
        stored = Datastore.getOrNull(Administrator.class, user.getUid());
        assertThat(stored, instanceOf(Administrator.class));
        assertThat(stored.getName(), is(name));
        assertThat(stored.getMail().getEmail(), is(mail));
        assertThat(stored.getRegisteredDate(), is(stored.getUpdatedDate()));
View Full Code Here

        try {
            Lock lock = getOrNull(ds, tx, key);
            if (lock != null
                && globalTransactionKey.equals(lock.globalTransactionKey)) {
                DatastoreUtil.delete(ds, tx, key);
                tx.commit();
            }
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
View Full Code Here

            Lock other = getOrNull(ds, tx, key);
            if (other != null) {
                verify(other);
            }
            DatastoreUtil.put(ds, tx, toEntity());
            tx.commit();
            return;
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
View Full Code Here

            if (otherEntity != null) {
                Lock other = toLock(ds, otherEntity);
                verify(other);
            }
            DatastoreUtil.put(ds, tx, toEntity());
            tx.commit();
            return map;
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
View Full Code Here

                }
                return;
            }
            gtx = new GlobalTransaction(ds, other.globalTransactionKey, false);
            GlobalTransaction.put(ds, tx, gtx);
            tx.commit();
        } catch (ConcurrentModificationException e) {
            throw createConcurrentModificationException(rootKey, e);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
View Full Code Here

            return false;
        } catch (EntityNotFoundRuntimeException e) {
            Entity entity = new Entity(key);
            try {
                put(tx, entity);
                tx.commit();
                return true;
            } catch (ConcurrentModificationException ignore) {
                return false;
            }
        } finally {
View Full Code Here

        Entity putEntity = new Entity(key);
        journalMap.put(key, putEntity);
        journalMap.put(key2, null);
        Transaction tx = ds.beginTransaction().get();
        Journal.apply(ds, tx, journalMap);
        tx.commit();
        assertThat(DatastoreUtil.getOrNull(ds, null, key), is(notNullValue()));
        assertThat(DatastoreUtil.getOrNull(ds, null, key2), is(nullValue()));
    }

    /**
 
View Full Code Here

        }
        Transaction tx = Datastore.beginTransaction();
        for (Object model : models) {
            Datastore.put(tx, model);
        }
        tx.commit();
        return data;
    }

    public UploadedData getData(Key key, Long version) {
        return Datastore.get(d, 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.