Package javax.transaction

Examples of javax.transaction.TransactionManager.commit()


      {
         initCaches(Configuration.CacheMode.REPL_SYNC);

         tm = beginTransaction();
         cache1.put("/a/b/c", "test", new ContainerData());
         tm.commit();

         // We should not come here.
         assertNotNull("NonSerializableData should not be null on cache2", cache2.get("/a/b/c", "test"));
      }
      catch (RollbackException rollback)
View Full Code Here


         tm.setRollbackOnly();
         throw e;
      }
      finally
      {
         tm.commit();
      }

   }

   private void checkHtml(String html, boolean checkBR)
View Full Code Here

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

      cache.removeNode(fqn);

      m.begin();
View Full Code Here

      cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
      assertTrue(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      cache.put(fqn, "x", "2");
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      assertEquals(0, cache.getNumberOfLocksHeld());
      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());

      // test normal operation again
      cache.removeNode(fqn);
View Full Code Here

      m.begin();
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      cache.put(fqn, "x", "3");
      assertFalse(cache.getInvocationContext().getOptionOverrides().isSuppressLocking());
      assertEquals(2, cache.getNumberOfLocksHeld());
      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());
   }

   /**
    * This one fails now.
View Full Code Here

      TransactionManager m = cache.getTransactionManager();

      m.begin();
      cache.put(fqn, "x", "1");
      assertEquals(2, cache.getNumberOfLocksHeld());
      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());

      cache.removeNode(fqn);

      m.begin();
View Full Code Here

      cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
      cache.put(fqn, "x", "2");
      cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
      cache.put(fqn1, "y", "3");
      assertEquals(0, cache.getNumberOfLocksHeld());
      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());

      Map<String, String> map = new HashMap<String, String>();
      map.put("x", "1");
      m.begin();
View Full Code Here

      cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
      cache.put(fqn, map);
      cache.getInvocationContext().getOptionOverrides().setSuppressLocking(true);
      cache.put(fqn1, map);
      assertEquals(0, cache.getNumberOfLocksHeld());
      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());

      // test normal operation again
      cache.removeNode(fqn);
View Full Code Here

      cache.removeNode(fqn);

      m.begin();
      cache.put(fqn, "x", "3");
      assertEquals(2, cache.getNumberOfLocksHeld());
      m.commit();
      assertEquals(0, cache.getNumberOfLocksHeld());
   }

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

      cache.put(fqn, key, value + 2);
      assertEquals(value + 2, cache.get(fqn, key));
      assertEquals(value, chainingCacheLoader.get(fqn).get(key));
      assertEquals(value, loader1.get(fqn).get(key));
      assertEquals(value, loader2.get(fqn).get(key));
      mgr.commit();
      assertEquals(value + 2, cache.get(fqn, key));
      assertEquals(value + 2, chainingCacheLoader.get(fqn).get(key));
      assertEquals(value + 2, loader1.get(fqn).get(key));
      assertEquals(value, loader2.get(fqn).get(key));
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.