Package javax.transaction

Examples of javax.transaction.TransactionManager.begin()


      assertEquals("value", cache1.get(fqn, "key"));
      mgr.commit();
      assertEquals("value", cache2.get(fqn, "key"));
      assertEquals("value", cache1.get(fqn, "key"));

      mgr.begin();
      cache1.put(fqn, "key2", "value2");
      assertEquals("value2", cache1.get(fqn, "key2"));
      mgr.rollback();
      assertEquals("value", cache2.get(fqn, "key"));
      assertEquals("value", cache1.get(fqn, "key"));
View Full Code Here


   {
      SyncReplTestTL srtl = threadLocal.get();
      CacheSPI<Object, Object> cache1 = srtl.cache1;

      TransactionManager mgr = cache1.getConfiguration().getRuntimeConfig().getTransactionManager();
      mgr.begin();
      return mgr;
   }

   protected Object getPersonFromClassloader(ClassLoader cl) throws Exception
   {
View Full Code Here

      try
      {
         cache = init(passivation);
         TransactionManager tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();

         tm.begin();
         assert cache.getNode(fqn.getParent().getParent()).getChildrenNames().size() == 1;
         assert cache.getNode(fqn.getParent()).getChildrenNames().size() == 1;
         tm.rollback();

         // in the fail scenario the rollback corrupts the parent node
View Full Code Here

         assert cache.getNode(fqn.getParent().getParent()).getChildrenNames().size() == 1;
         assert cache.getNode(fqn.getParent()).getChildrenNames().size() == 1;
         tm.rollback();

         // in the fail scenario the rollback corrupts the parent node
         tm.begin();
         assert cache.getNode(fqn.getParent().getParent()).getChildrenNames().size() == 1;
         // watch here:
         int sz = cache.getNode(fqn.getParent()).getChildrenNames().size();
         assert sz == 1 : "Expecting 1, was " + sz;
         tm.commit();
View Full Code Here

      cache2.start();

      TestingUtil.blockUntilViewsReceived(10000, cache1, cache2);

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

      cache1.put(Fqn.fromString("/replicate"), "k", "v");
      cache1.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
      cache1.put(Fqn.fromString("/not-replicate"), "k", "v");
View Full Code Here

   }

   private TransactionManager beginTransaction() throws SystemException, NotSupportedException
   {
      TransactionManager mgr = cache1.getConfiguration().getRuntimeConfig().getTransactionManager();
      mgr.begin();
      return mgr;
   }

   private void initCaches(Configuration.CacheMode caching_mode)
   {
View Full Code Here

      wrapper.create();
      wrapper.start();

      TransactionManager tm = config.getRuntimeConfig().getTransactionManager();

      tm.begin();
      try
      {
         Fqn fqn = Fqn.fromString("/testing/jmx");
         cache.put(fqn, "foobar", "barfoo");
View Full Code Here

   public void testSuppressionOfWriteLocks() throws Exception
   {
      TransactionManager m = cache.getTransactionManager();

      m.begin();
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      cache.put(fqn, "x", "1");
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      assertEquals(2, cache.getNumberOfLocksHeld());
      m.commit();
View Full Code Here

      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());

      cache.removeNode(fqn);

      m.begin();
      cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
      assertTrue(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      cache.put(fqn, "x", "2");
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      assertEquals(0, cache.getNumberOfLocksHeld());
View Full Code Here

      assertEquals(0, cache.getNumberOfLocksHeld());

      // test normal operation again
      cache.removeNode(fqn);

      m.begin();
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      cache.put(fqn, "x", "3");
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      assertEquals(2, cache.getNumberOfLocksHeld());
      m.commit();
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.