Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.DummyTransactionManager.suspend()


        Transaction tx = mgr.getTransaction();
        System.out.println("Current TX " + mgr.getTransaction());
        assertEquals(pojo1, cache.get("/one/two", "key1"));

        // start another
        mgr.suspend();

        mgr.begin();
        System.out.println("Current TX " + mgr.getTransaction());
        cache.put("/one/two", "key2", pojo2);
View Full Code Here


        mgr.begin();
        Transaction tx = mgr.getTransaction();
        assertEquals(1, cache.getKeys("/one/two").size());
        // start another
        mgr.suspend();

        mgr.begin();
        cache.put("/one/two", "key2", pojo);

        mgr.commit();
View Full Code Here

        mgr.begin();
        Transaction tx = mgr.getTransaction();
        cache.put("/one/two", "key2", "val2"); // version for this is 1

        // start another
        mgr.suspend();

        // Second TX
        mgr.begin();
        cache.put("/one/two", "key3", "val3");
        mgr.commit(); // now version is 2, attrs are key1 and key3
View Full Code Here

        mgr.begin();
        cache.put(fqn, key, value);
        Assert.assertEquals(value, cache.get(fqn, key));
        tx = mgr.getTransaction();
        mgr.suspend();

        mgr.begin();
        Assert.assertNull(cache.get(fqn, key));
        mgr.commit();
View Full Code Here

        mgr.begin();
        Assert.assertEquals(value, cache.get(fqn, key));
        cache.remove(fqn);
        Assert.assertNull(cache.get(fqn));
        tx = mgr.getTransaction();
        mgr.suspend();

        mgr.begin();
        Assert.assertEquals(value, cache.get(fqn, key));
        mgr.commit();
View Full Code Here

        mgr.begin();
        cache.remove(fqn);
        Assert.assertNull(cache.get(fqn));
        tx = mgr.getTransaction();
        mgr.suspend();

        mgr.begin();
        Assert.assertEquals(value, cache.get(fqn, key));
        mgr.commit();
View Full Code Here

        SamplePojo pojo = new SamplePojo(21, "test");

        cache.put("/one/two", "key1", pojo);

        //suspend current transaction
        mgr.suspend();

        //start a new transaction
        mgr.begin();
        Transaction tx2 = mgr.getTransaction();
        cache.getInvocationContext().setTransaction(tx2);
View Full Code Here

        SamplePojo pojo = new SamplePojo(21, "test");

        cache.put("/one/two", "key1", pojo);

        mgr.suspend();

        assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(1, cache.getTransactionTable().getNumLocalTransactions());

        assertNull(mgr.getTransaction());
View Full Code Here

        SamplePojo pojo = new SamplePojo(21, "test");

        cache.put("/one/two", "key1", pojo);

        mgr.suspend();

        assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(1, cache.getTransactionTable().getNumLocalTransactions());

        GlobalTransaction gtx = cache.getCurrentTransaction(tx);
View Full Code Here

        // start the 1st tx
        mgr.begin();
        tx = mgr.getTransaction();
        Assert.assertEquals(value, cache.get(fqn, key));
        mgr.suspend();

        // start a new tx
        mgr.begin();
        Assert.assertEquals(value, cache.get(fqn, key));
        mgr.commit();
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.