Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.DummyTransactionManager.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();

        // assert we can see this outsode the existing tx
View Full Code Here


        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        if (mgr.getTransaction() != null) mgr.rollback();
        assertNull(mgr.getTransaction());

        // first put in a value
        mgr.begin();
        assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
        cache.put("/one/two", "key1", "val1");
        mgr.commit();
        keys = cache.getKeys("/one/two");
View Full Code Here

        keys = cache.getKeys("/one/two");
        System.out.println("keys after TX #1: " + keys);
        assertEquals(1, keys.size());

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

        // start another
        mgr.suspend();
View Full Code Here

        // 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

        // assert we can see this outside the existing tx
        keys = cache.getKeys("/one/two");
View Full Code Here

        Transaction tx;

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        Assert.assertNull(cache.get(fqn));

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

        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();

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

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        Assert.assertNull(cache.get(fqn));
        cache.put(fqn, key, value);
        Assert.assertEquals(value, cache.get(fqn, key));

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

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

        mgr.begin();
        Assert.assertEquals(value, cache.get(fqn, key));
        mgr.commit();

        mgr.resume(tx);
        Assert.assertNull(cache.get(fqn));
View Full Code Here

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        Assert.assertNull(cache.get(fqn));
        cache.put(fqn, key, value);
        Assert.assertEquals(value, cache.get(fqn, key));

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

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

        mgr.begin();
        Assert.assertEquals(value, cache.get(fqn, key));
        mgr.commit();

        mgr.resume(tx);
        Assert.assertNull(cache.get(fqn));
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.