Package javax.transaction

Examples of javax.transaction.TransactionManager.suspend()


      TransactionManager mgr = c.getTransactionManager();
      try
      {
         mgr.begin();
         c.put("/a", "k", "v");
         Transaction t = mgr.suspend();
         c.put("/a", "k2", "v2");
         mgr.resume(t);
         mgr.commit();
         assertTrue("Expecting a rollback exception!", false);
      }
View Full Code Here


      TransactionManager mgr = c.getTransactionManager();
      mgr.begin();

      c.put(fqn, "key2", "value2");

      Transaction tx = mgr.suspend();

      // now remove the original node...
      c.removeNode(fqn);

      mgr.resume(tx);
View Full Code Here

      TransactionManager mgr = c.getTransactionManager();
      mgr.begin();

      c.put(fqn, "key2", "value2");

      Transaction tx = mgr.suspend();

      // now change the original node...
      c.put(fqn, "key3", "value3");

      mgr.resume(tx);
View Full Code Here

      assertEquals("value", cache.get("/a", "key"));
      assertEquals(0, cache.getNumberOfLocksHeld());

      mgr.begin();
      cache.put("/b", "key", "value");
      Transaction tx1 = mgr.suspend();

      mgr.begin();
      cache.put("/b", "key", "value2");
      mgr.commit();
View Full Code Here

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

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

      mgr.suspend();

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

      assertNull(mgr.getTransaction());
View Full Code Here

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

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

      mgr.suspend();

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

      GlobalTransaction gtx = cache.getCurrentTransaction(tx, true);
View Full Code Here

      Transaction tx = mgr.getTransaction();
      System.out.println("Current TX " + mgr.getTransaction());
      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);
View Full Code Here

      mgr.begin();
      Transaction tx = mgr.getTransaction();
      assertEquals(1, cache.getNode("/one/two").getKeys().size());
      // start another
      mgr.suspend();

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

      mgr.commit();
View Full Code Here

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

      // 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
View Full Code Here

      cache.put("/a/b/c", null);
      tx.begin();
      cache.removeNode("/a/b/c");
      // this node should now be locked.
      TransactionManager tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      Transaction t = tm.suspend();
      // start a new tx
      tm.begin();
      try
      {
         cache.getNode("/a/b/c");// should fail
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.