Package javax.transaction

Examples of javax.transaction.RollbackException


         if (status != Status.STATUS_ACTIVE && status != Status.STATUS_PREPARING && status != Status.STATUS_PREPARED && status != Status.STATUS_COMMITTING)
         {
            if (status == Status.STATUS_MARKED_ROLLBACK && IGNORE_STATUS_MARKED_FOR_ROLLBACK)
               // allow database access even though transaction is marked to fail
            else
               throw new RollbackException("Transaction " + tx + " cannot proceed " + TxUtils.getStatusAsString(status));
         }
      }
   }
View Full Code Here


              }
              ,
              {
                 // thread 1
                 new MTOperation(MTOperation.XX_WAIT_FOR, 10)
                 new MTOperation(MTOperation.TX_COMMIT, 10, new RollbackException()),
                 new MTOperation(MTOperation.TM_GET_STATUS),
              }
           });        
      }
      else
View Full Code Here

               // thread 1
               new MTOperation(MTOperation.TM_GET_STATUS),                 
               new MTOperation(MTOperation.XX_WAIT_FOR, 10),              
               new MTOperation(MTOperation.TM_RESUME, 10),
               new MTOperation(MTOperation.TM_GET_STATUS),              
               new MTOperation(MTOperation.TX_COMMIT, 10, new RollbackException()),
               new MTOperation(MTOperation.TM_GET_STATUS),              
            }
         });
      }
      else
View Full Code Here

               new MTOperation(MTOperation.TM_GET_STATUS),
               new MTOperation(MTOperation.XX_SLEEP_200),
               new MTOperation(MTOperation.TM_GET_STATUS),

               // FIXME - JBTM-558
               new MTOperation(MTOperation.TM_COMMIT, -1, new RollbackException(), false)

            }
            ,
            {
               // thread 1
View Full Code Here

            status = Status.STATUS_COMMITTED;

        } catch (XAException e) {

            if (e.errorCode >= XAException.XA_RBBASE && e.errorCode <= XAException.XA_RBEND) {
                throw new RollbackException(e.toString());
            }

            throw new SystemException("Unable to commit transaction: " + "XA_ERR=" + e.errorCode);
        }
    }
View Full Code Here

      try
      {
         if (delegate.getRollbackOnly())
         {
            delegate.rollback();
            throw new RollbackException();
         }
         else
         {
            getSynchronizations().beforeTransactionCommit();
            delegate.commit();
View Full Code Here

        return initCause(new NamingException(), cause);
    }


    public static RollbackException newRollbackException(String message, Throwable cause){
        return initCause(new RollbackException(message), cause);
    }
View Full Code Here

    public static RollbackException newRollbackException(String message, Throwable cause){
        return initCause(new RollbackException(message), cause);
    }

    public static RollbackException newRollbackException(Throwable cause){
        return initCause(new RollbackException(), cause);
    }
View Full Code Here

        switch (status) {
            case Status.STATUS_ACTIVE:
            case Status.STATUS_PREPARING:
                break;
            case Status.STATUS_MARKED_ROLLBACK:
                throw new RollbackException("Transaction is marked for rollback");
            default:
                throw new IllegalStateException("Status is " + getStateString(status));
        }
        syncList.add(synch);
    }
View Full Code Here

        }
        switch (status) {
            case Status.STATUS_ACTIVE:
                break;
            case Status.STATUS_MARKED_ROLLBACK:
                throw new RollbackException("Transaction is marked for rollback");
            default:
                throw new IllegalStateException("Status is " + getStateString(status));
        }

        if (activeXaResources.containsKey(xaRes)) {
View Full Code Here

TOP

Related Classes of javax.transaction.RollbackException

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.