Examples of TransactionOptions


Examples of com.google.appengine.api.datastore.TransactionOptions

    }

    // transactionOptions setting
    @Test
    public void testTransactionOptions() {
        TransactionOptions tos = TransactionOptions.Builder.withXG(true);
        assertEquals(true, tos.isXG());
        tos.clearXG();
        assertEquals(false, tos.isXG());
    }
View Full Code Here

Examples of com.google.appengine.api.datastore.TransactionOptions

        clearData(kindName);
        clearData(otherKind);
        GroupParentKeys keys = writeMultipleGroup(true);
        List<Entity> es = readMultipleGroup(keys);

        TransactionOptions tos = TransactionOptions.Builder.withXG(true);
        Transaction tx = service.beginTransaction(tos);
        es.get(0).setProperty("check", "parent-update");
        es.get(1).setProperty("check", "other-update");
        service.put(tx, es);
        tx.rollback();
View Full Code Here

Examples of com.google.appengine.api.datastore.TransactionOptions

        NamespaceManager.set("");
        clearData(kindName);
        NamespaceManager.set("trns");
        try {
            clearData(kindName);
            TransactionOptions tos = TransactionOptions.Builder.withXG(false);
            Transaction tx = service.beginTransaction(tos);
            try {
                List<Entity> es = new ArrayList<>();
                NamespaceManager.set("");
                Entity ens1 = new Entity(kindName);
View Full Code Here

Examples of com.google.appengine.api.datastore.TransactionOptions

        NamespaceManager.set("");
        clearData(kindName);
        NamespaceManager.set("trns");
        clearData(kindName);
        List<Entity> es = new ArrayList<>();
        TransactionOptions tos = TransactionOptions.Builder.withXG(true);
        Transaction tx = service.beginTransaction(tos);

        NamespaceManager.set("");
        Entity ens1 = new Entity(kindName);
        ens1.setProperty("check", "entity-nons");
View Full Code Here

Examples of com.google.appengine.api.datastore.TransactionOptions

    private GroupParentKeys writeMultipleGroup(boolean allow) throws Exception {

        GroupParentKeys keys = new GroupParentKeys();

        TransactionOptions tos = TransactionOptions.Builder.withXG(allow);
        Transaction tx = service.beginTransaction(tos);
        try {
            Entity parent = new Entity(kindName);
            parent.setProperty("check", "parent");
            parent.setProperty("stamp", new Date());
View Full Code Here

Examples of com.google.appengine.api.datastore.TransactionOptions

    private GroupParentKeys writeMultipleInList(boolean allow) throws Exception {

        GroupParentKeys keys = new GroupParentKeys();

        List<Entity> es = new ArrayList<>();
        TransactionOptions tos = TransactionOptions.Builder.withXG(allow);
        Transaction tx = service.beginTransaction(tos);
        try {
            Entity parent = new Entity(kindName);
            parent.setProperty("check", "parent");
            parent.setProperty("stamp", new Date());
View Full Code Here

Examples of com.hazelcast.transaction.TransactionOptions

    @Override
    public void read(PortableReader reader) throws IOException {
        super.read(reader);
        ObjectDataInput in = reader.getRawDataInput();
        options = new TransactionOptions();
        options.readData(in);
        boolean sXidNotNull = in.readBoolean();
        if (sXidNotNull) {
            sXid = new SerializableXID();
            sXid.readData(in);
View Full Code Here

Examples of com.hazelcast.transaction.TransactionOptions

            if (useRecovery) {
                LOG.trace("Removing an exchange with ID {} for key {} in a thread-safe manner.", exchange.getExchangeId(), key);
                // The only considerable case for transaction usage is fault tolerance:
                // the transaction will be rolled back automatically (default timeout is 2 minutes)
                // if no commit occurs during the timeout. So we are still consistent whether local node crashes.
                TransactionOptions tOpts = new TransactionOptions();

                tOpts.setTransactionType(TransactionOptions.TransactionType.LOCAL);
                TransactionContext tCtx = hzInstance.newTransactionContext(tOpts);

                try {

                    tCtx.beginTransaction();
View Full Code Here

Examples of com.hazelcast.transaction.TransactionOptions

    public void setTxContext(TransactionContext txContext) {
        this.txContext = txContext;
    }

    public static TransactionContext createTransaction(int timeout, HazelcastInstance hazelcastInstance) throws XAException {
        final TransactionOptions transactionOptions = TransactionOptions.getDefault().setTimeout(timeout, TimeUnit.SECONDS);
        return hazelcastInstance.newTransactionContext(transactionOptions);
    }
View Full Code Here

Examples of com.hazelcast.transaction.TransactionOptions

    @Override
    public void read(PortableReader reader) throws IOException {
        super.read(reader);
        ObjectDataInput in = reader.getRawDataInput();
        options = new TransactionOptions();
        options.readData(in);
        boolean sXidNotNull = in.readBoolean();
        if (sXidNotNull) {
            sXid = new SerializableXID();
            sXid.readData(in);
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.