Package org.jboss.tm

Examples of org.jboss.tm.TransactionLocal


      assertEquals("Initial", local.get(null));
   }
  
   public void testSetNoTxExplicit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      try
      {
         local.set(null, "Something");
         fail("Should not be here");
      }
      catch (IllegalStateException expected)
      {
      }
View Full Code Here


      }
   }
  
   public void testGetAfterCommit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      try
      {
         local.set("Something");
      }
      finally
      {
         tm.commit();
      }
      assertEquals(null, local.get());
   }
View Full Code Here

      assertEquals(null, local.get());
   }
  
   public void testGetInitialAfterCommit() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      tm.begin();
      try
      {
         local.set("Something");
         assertEquals("Something", local.get());
      }
      finally
      {
         tm.commit();
      }
      assertEquals("Initial", local.get());
   }
View Full Code Here

      assertEquals("Initial", local.get());
   }
  
   public void testGetMarkedRolledBack() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      tm.setRollbackOnly();
      try
      {
         assertEquals(null, local.get());
      }
      finally
      {
         tm.rollback();
      }
View Full Code Here

      }
   }
  
   public void testGetInitialMarkedRolledBack() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      tm.begin();
      tm.setRollbackOnly();
      try
      {
         assertEquals("Initial", local.get());
      }
      finally
      {
         tm.rollback();
      }
View Full Code Here

      }
   }
  
   public void testSetMarkedRolledBack() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      tm.setRollbackOnly();
      try
      {
         local.set("Something");
         assertEquals("Something", local.get());
      }
      finally
      {
         tm.rollback();
      }
View Full Code Here

      }
   }
  
   public void testGetAfterComplete() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      Transaction tx = tm.getTransaction();
      try
      {
         local.set("Something");
      }
      finally
      {
         tx.commit();
      }
      assertEquals(null, local.get());
      tm.suspend();
   }
View Full Code Here

      tm.suspend();
   }
  
   public void testGetInitialAfterComplete() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm)
      {
         protected Object initialValue()
         {
            return "Initial";
         }
      };
      tm.begin();
      Transaction tx = tm.getTransaction();
      try
      {
         local.set("Something");
         assertEquals("Something", local.get());
      }
      finally
      {
         tx.commit();
      }
      assertEquals("Initial", local.get());
      tm.suspend();
   }
View Full Code Here

      tm.suspend();
   }
  
   public void testSuspendResume() throws Exception
   {
      TransactionLocal local = new TransactionLocal(tm);
      tm.begin();
      Transaction tx1 = tm.getTransaction();
      try
      {
         local.set("Something");
         assertEquals("Something", local.get());
         tm.suspend();
         tm.begin();
         try
         {
            Transaction tx2 = tm.getTransaction();
            assertEquals(null, local.get());
            assertEquals("Something", local.get(tx1));
            tm.suspend();
            tm.resume(tx1);
            assertEquals("Something", local.get());
            assertEquals(null, local.get(tx2));
            tm.suspend();
            tm.resume(tx2);
         }
         finally
         {
View Full Code Here

   @Override
   public void setUp()
   {
  tm = TransactionManagerLocator.getInstance().locate();
  local = new TransactionLocal(tm);
   }
View Full Code Here

TOP

Related Classes of org.jboss.tm.TransactionLocal

Copyright © 2018 www.massapicom. 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.