Package org.jboss.cache.transaction

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


      addDelay();
      mgr.begin();

      cache.put("/one/two/three", "key1", "val1");
      cache.put("/one/two/three/four", "key2", "val2");
      mgr.rollback();
      addDelay();
      assertNull(cache.getNode("/one/two/three"));
      assert cache.getNode("/one") == null;

      assertFalse(loader.exists(Fqn.fromString("/one/two/three")));
View Full Code Here


      addDelay();
      mgr.begin();

      cache.put("/one/two/three", "key1", "val1");
      cache.put("/one/two/three/four", "key2", "val2");
      mgr.rollback();
      addDelay();
      assertNull(cache.getNode("/one/two/three"));
      assert cache.getNode("/one") == null;

      assertFalse(loader.exists(Fqn.fromString("/one/two/three")));
View Full Code Here

    {

        TreeCache cache = createCacheWithListener();

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

        // first put in a value
        mgr.begin();
View Full Code Here

    {
        TreeCache cache = createCacheWithListener();
        Set keys;

        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());
View Full Code Here

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

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

        mgr.rollback();

        assertNull(mgr.getTransaction());
        assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
View Full Code Here

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

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

        assertNotNull(mgr.getTransaction());
        mgr.rollback();

        assertNull(mgr.getTransaction());

        List calls = dummy.getAllCalled();
        assertEquals(1, calls.size());
View Full Code Here

        //start local transaction
        mgr.begin();

        assertNotNull(mgr.getTransaction());
        mgr.rollback();

        assertNull(mgr.getTransaction());

        List calls = dummy.getAllCalled();
        assertEquals(0, calls.size());
View Full Code Here

        assertEquals(MethodDeclarations.optimisticPrepareMethod, calls.get(0));
        assertEquals(MethodDeclarations.commitMethod, calls.get(1));
        boolean failed = false;
        try
        {
            mgr.rollback();
            fail();
        }
        catch (Exception e)
        {
            e.printStackTrace();
View Full Code Here

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

        SamplePojo pojo = new SamplePojo(21, "test");
        mgr.begin();
        cache.put("/one/two", "key1", pojo);
        mgr.rollback();
        assertNull(mgr.getTransaction());
        assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());

        //make sure all calls were done in right order
View Full Code Here

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

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

        mgr.rollback();

        assertNull(mgr.getTransaction());
        assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
        assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
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.