Package org.jboss.cache.transaction

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


      mgr.commit();

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

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

      mgr.commit();
View Full Code Here


   }

   public void testTxReadCommit() throws Exception
   {
      DummyTransactionManager mgr = DummyTransactionManager.getInstance();
      mgr.begin();

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

      mgr.commit();
View Full Code Here

      mgr.commit();

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

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

      mgr.commit();
View Full Code Here

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

   {
      DummyTransactionManager mgr = DummyTransactionManager.getInstance();

      cache.removeNode("/one");
      addDelay();
      mgr.begin();

      cache.put("/one/two/three", "key1", "val1");
      cache.put("/one/two/three/four", "key2", "val2");
      mgr.rollback();
      addDelay();
View Full Code Here

   public void testBasicOperationsTransactional()
         throws Exception
   {

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

   /**
 
View Full Code Here

    */
   public void testModificationsTransactional()
         throws Exception
   {
      DummyTransactionManager mgr = DummyTransactionManager.getInstance();
      mgr.begin();
      doTestModifications();
      mgr.commit();
   }

   /**
 
View Full Code Here

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

        // assert we can see this INSIDE the existing tx
        //assertEquals(pojo2, cache.get("/one/two", "key2"));
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());

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

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

        mgr.commit();

        mgr.begin();
        Transaction tx = mgr.getTransaction();
        assertEquals(1, cache.getKeys("/one/two").size());
        // start another
        mgr.suspend();
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.