Package javax.transaction

Examples of javax.transaction.TransactionManager.commit()


         assert cache.get(fqn, "k").equals("v");
         assert cache.getRoot().getChildren().size() == 1;
         tm.setRollbackOnly();
         try
         {
            tm.commit();
            assert false : "Should have rolled back";
         }
         catch (RollbackException expected)
         {
         }
View Full Code Here


         {
           assert expected.getCause() instanceof RollbackException : "exception wrapped and thrown should be RollbackException. Exception class "+expected.getCause().getClass();
         }
         try
         {
            tm.commit();
            assert false : "Should have rolled back";
         }
         catch (RollbackException expected)
         {
View Full Code Here

         public void run()
         {
            try
            {
               tm.resume(tx);
               tm.commit();
            }
            catch (Exception e)
            {
            }
         }
View Full Code Here

               // notify the reading thread
               readerCanRead.countDown();

               readerDone.await();

               tx.commit();
            }
            catch (AssertionError e)
            {
               writerError = e;
            }
View Full Code Here

               // notify the reading thread
               readerCanRead.countDown();

               readerDone.await();

               tm.commit();
            }
            catch (AssertionError e)
            {
               writerError = e;
            }
View Full Code Here

      TransactionManager tm = getTransactionManager(cache);
      tm.begin();
      cache.put("/a/b/c", "k", "v");
      cache.startBatch();
      cache.put("/a/b/c", "k2", "v2");
      tm.commit();

      assert "v".equals(cache.get("/a/b/c", "k"));
      assert "v2".equals(cache.get("/a/b/c", "k2"));

      cache.endBatch(false); // should be a no op
View Full Code Here

      assert getOnDifferentThread(cache, "/a/b/c", "k") == null;
      assert getOnDifferentThread(cache, "/a/b/c", "k2") == null;

      try
      {
         tm.commit(); // should have no effect
      }
      catch (Exception e)
      {
         // the TM may barf here ... this is OK.
      }
View Full Code Here

      // basic node manipulation events
      if (tx)
         tm.begin();
      cache1.put(fqn, "k", "v");
      if (tx)
         tm.commit();
      if (tx)
         tm.begin();
      cache1.get(fqn, "k");
      if (tx)
         tm.commit();
View Full Code Here

         tm.commit();
      if (tx)
         tm.begin();
      cache1.get(fqn, "k");
      if (tx)
         tm.commit();
      if (tx)
         tm.begin();
      cache1.put(fqn, "k", "v2");
      if (tx)
         tm.commit();
View Full Code Here

         tm.commit();
      if (tx)
         tm.begin();
      cache1.put(fqn, "k", "v2");
      if (tx)
         tm.commit();
      if (tx)
         tm.begin();
      cache1.removeNode(fqn);
      if (tx)
         tm.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.