Package org.jboss.cache.transaction

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


      mgr.begin();

      cache.put("/one/two/three", "key1", "val1");
      cache.put("/one/two/three/four", "key2", "val2");

      mgr.commit();

      assertNotNull(cache.getNode("/one/two/three").getKeys());
      assertEquals("val1", cache.get(Fqn.fromString("/one/two/three"), "key1"));
      mgr.begin();
View Full Code Here


      mgr.begin();

      cache.evict(Fqn.fromString("/one/two/three"));
      cache.evict(Fqn.fromString("/one/two/three/four"));

      mgr.commit();
      assertTrue(loader.exists(Fqn.fromString("/one/two/three")));
      assertTrue(loader.exists(Fqn.fromString("/one/two/three/four")));

      // now do a READ in a TX
      mgr.begin();
View Full Code Here

      // now do a READ in a TX
      mgr.begin();
      assert cache.get("/one/two/three", "key1").equals("val1");
      assert cache.get("/one/two/three/four", "key2").equals("val2");
      mgr.commit();

      // these should NOT exist in the CL anymore!
      assert !loader.exists(Fqn.fromString("/one/two/three/four"));
   }
View Full Code Here

   {

      DummyTransactionManager mgr = DummyTransactionManager.getInstance();
      mgr.begin();
      doTestBasicOperations();
      mgr.commit();
   }

   /**
    * Tests basic operations.
    */
 
View Full Code Here

         throws Exception
   {
      DummyTransactionManager mgr = DummyTransactionManager.getInstance();
      mgr.begin();
      doTestModifications();
      mgr.commit();
   }

   /**
    * Tests modifications.
    */
 
View Full Code Here

        cache.put("/one/two", "key2", pojo2);

        // assert we can see this INSIDE the existing tx
        //assertEquals(pojo2, cache.get("/one/two", "key2"));

        mgr.commit();

        // assert we can see this outside the existing tx
        assertEquals(pojo2, cache.get("/one/two", "key2"));
        System.out.println("Current TX " + mgr.getTransaction());
        // resume the suspended one
View Full Code Here

        // resume the suspended one
        mgr.resume(tx);
        System.out.println("Current TX " + mgr.getTransaction());
        // assert we can't see the change from tx2 as we already touched the node
        assertEquals(null, cache.get("/one/two", "key2"));
        mgr.commit();
        destroyCache(cache);
    }

    public void testGetKeysIsolationTransaction() throws Exception
    {
View Full Code Here

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

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

        mgr.commit();

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

        mgr.suspend();

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

        mgr.commit();

        // assert we can see this outsode the existing tx
        assertEquals(2, cache.getKeys("/one/two").size());

        // resume the suspended one
View Full Code Here

        // resume the suspended one
        mgr.resume(tx);
        // assert we can't see thge change from tx2 as we already touched the node
        assertEquals(1, cache.getKeys("/one/two").size());
        mgr.commit();
        destroyCache(cache);

    }

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.