Package org.jboss.cache.transaction

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


        cache.setInterceptorChain(interceptor);

//     first set up a node with a pojo
        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        mgr.begin();
        Transaction tx = mgr.getTransaction();

        // inject InvocationContext
        cache.getInvocationContext().setTransaction(tx);
        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
View Full Code Here


        // should be nothing in the loader
        Assert.assertEquals(value, cache.get(fqn, key));
        Assert.assertNull(loader.get(fqn));

        // evict from cache
        mgr.begin();
        cache.evict(fqn);
        mgr.commit();

        mgr.begin();
        // should now be passivated in the loader
View Full Code Here

        // evict from cache
        mgr.begin();
        cache.evict(fqn);
        mgr.commit();

        mgr.begin();
        // should now be passivated in the loader
        // don't do a cache.get() first as this will activate this node from the loader again!
        // Assert.assertNull( cache.get( fqn ) );
        Assert.assertEquals(value, loader.get(fqn).get(key));
View Full Code Here

        // and the object should now be removed from the loader
        Assert.assertNull(loader.get(fqn));
        mgr.commit();

        // clean up
        mgr.begin();
        cache.remove(fqn);
        loader.remove(fqn);
        mgr.commit();

    }
View Full Code Here

        TreeCache cache = createCacheWithListener();

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        assertNull(mgr.getTransaction());

        mgr.begin();

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

        SamplePojo pojo = new SamplePojo(21, "test");
View Full Code Here

        TreeCache cache = createCacheWithListener();

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        assertNull(mgr.getTransaction());

        mgr.begin();

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

        SamplePojo pojo = new SamplePojo(21, "test");
View Full Code Here

        TreeCache cache = createSyncReplicatedCache();

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        assertNull(mgr.getTransaction());

        mgr.begin();

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

        SamplePojo pojo = new SamplePojo(21, "test");
View Full Code Here

        TreeCache cache = createSyncReplicatedCache();

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        assertNull(mgr.getTransaction());

        mgr.begin();

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

        SamplePojo pojo = new SamplePojo(21, "test");
View Full Code Here

        TreeCache cache = createSyncReplicatedCache();

        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
        assertNull(mgr.getTransaction());

        mgr.begin();
        Transaction tx = mgr.getTransaction();
        assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());

        SamplePojo pojo = new SamplePojo(21, "test");
View Full Code Here

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

        assertNull(mgr.getTransaction());

        mgr.begin();

        SamplePojo pojo2 = new SamplePojo(22, "test2");

        cache.put("/one/two", "key1", pojo2);
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.