Package javax.transaction

Examples of javax.transaction.UserTransaction.rollback()


   public void rollback() throws IllegalStateException, SecurityException, SystemException
   {
      UserTransaction userTransaction = ejbContext.getUserTransaction();
      try
      {
         userTransaction.rollback();
      }
      finally
      {
         getSynchronizations().afterTransactionCompletion(false);
      }
View Full Code Here


            utx.begin();
            em.joinTransaction();
            out = call.call(em);
            utx.commit();
        } catch (Exception e) {
            utx.rollback();
        } finally {
            em.close();
        }

        return out;
View Full Code Here

                    clearTransactionStamps();
                    // clear out the stack too
                    clearTransactionBeginStack();
                    clearSetRollbackOnlyCause();

                    ut.rollback();
                    Debug.logInfo("[TransactionUtil.rollback] transaction rolled back", module);
                } else {
                    Debug.logWarning("[TransactionUtil.rollback] transaction not rolled back, status is STATUS_NO_TRANSACTION", module);
                }
            } catch (IllegalStateException e) {
View Full Code Here

        // insert and rollback
        ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
        ut.begin();
        ksession.insert( 3 );
        ut.rollback();

        // check we rolled back the state changes from the 3rd insert
        ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
        ut.begin();
        ksession.fireAllRules();
View Full Code Here

        // rollback again, this is testing that we can do consecutive rollbacks and commits without issue
        ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
        ut.begin();
        ksession.insert( 5 );
        ksession.insert( 6 );
        ut.rollback();

        ksession.fireAllRules();

        assertEquals( 4,
                      list.size() );
View Full Code Here

            System.out.println("WR2 sees this after commit " + thisIsWhatTx2Sees);
           
        } catch (Exception e) {
            if (tx != null)
                try {
                    tx.rollback();
                } catch (IllegalStateException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (SecurityException e1) {
                    // TODO Auto-generated catch block
View Full Code Here

               tx.begin();
               if (checkAndSetState())
               {
                  try
                  {
                     tx.rollback();
                  }
                  catch (Exception e)
                  {
                  }
                  return;
View Full Code Here

                  cache.put(fqn, m, i);
                  if (checkAndSetState())
                  {
                     try
                     {
                        tx.rollback();
                     }
                     catch (Exception e)
                     {
                     }
                     return;
View Full Code Here

                  again = false;
               }
               catch (TimeoutException timeout_ex)
               {
                  System.out.println("transaction is rolled back, will try again (ex=" + timeout_ex.getClass() + ")");
                  tx.rollback();
                  again = true;
               }
               catch (Throwable e)
               {
                  System.out.println("transaction is rolled back, will try again (ex=" + e.getMessage() + ")");
View Full Code Here

                  again = true;
               }
               catch (Throwable e)
               {
                  System.out.println("transaction is rolled back, will try again (ex=" + e.getMessage() + ")");
                  tx.rollback();
                  again = true;
               }
               anz++;
               yield();
            }
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.