Package javax.transaction

Examples of javax.transaction.UserTransaction.rollback()


      assertTrue("age == 40", bean.getPersonsAge() == 40);

      ut.begin();
      bean.setPersonsAge(100);
      ut.rollback();
      assertTrue("age == 40", bean.getPersonsAge() == 40);

      bean.remove();
      ctx.close();
   }
View Full Code Here


      assertTrue("age == 40", bean.getPersonsAge() == 40);

      ut.begin();
      bean.setPersonsAge(100);
      ut.rollback();
      assertTrue("age == 40", bean.getPersonsAge() == 40);

      bean.remove();
      ctx.close();
   }
View Full Code Here

         }
         finally
         {
            try
            {
               ut.rollback();
            }
            catch (Exception ignored)
            {
            }
         }
View Full Code Here

      {
         // expected
      }
      finally
      {
         ut.rollback();
      }
   }

   public static Test suite() throws Exception
   {
View Full Code Here

            }

            public void rollback() throws IllegalStateException, SecurityException, SystemException
            {
               checkUserTransactionMethods();
               ut.rollback();
            }

            public void setRollbackOnly() throws IllegalStateException, SystemException
            {
               checkUserTransactionMethods();
View Full Code Here

      catch (Exception e)
      {
         try
         {
            if (t != null)
               t.rollback();
         }
         catch (SystemException e1) {}
        
         throw new RuntimeException("Error starting transaction", e);
      }     
View Full Code Here

      catch (Exception e)
      {
         try
         {
            if (t != null)
               t.rollback();
         }
         catch (SystemException e1) {}
        
         throw new RuntimeException("Error starting transaction", e);
      }     
View Full Code Here

            }

        } else if (action.equals(ACTION_ROLLBACK)) {

            try {
                tx.rollback();
            } catch (Exception e) {
                handleException("Unable to rollback transaction", e, synCtx);
            }

        } else if (action.equals(ACTION_NEW)) {
View Full Code Here

         if (newTransactionRequired)
         {
            if (transaction.isMarkedRollback())
            {
               log.debug("rolling back transaction");
               userTransaction.rollback();
            }
            else
            {
               log.debug("committing transaction");
               userTransaction.commit();
View Full Code Here

      catch (Exception e)
      {
         if (newTransactionRequired && userTransaction.getStatus() != Status.STATUS_NO_TRANSACTION && isRollbackRequired(e, true))
         {
            log.debug("rolling back transaction");
            userTransaction.rollback();
         }
         throw e;
      }
     
   }
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.