Package javax.transaction

Examples of javax.transaction.RollbackException


    int status = getStatus();

    switch (status)
    {
    case javax.transaction.Status.STATUS_MARKED_ROLLBACK:
      throw new RollbackException(
          "TransactionImple.enlistResource - "
              + jtaLogger.logMesg
                  .getString("com.arjuna.ats.internal.jta.transaction.arjunacore.nullres"));
    case javax.transaction.Status.STATUS_ACTIVE:
      break;
View Full Code Here


          case ActionStatus.H_HAZARD:
            throw new javax.transaction.HeuristicMixedException();
          case ActionStatus.H_ROLLBACK:
          case ActionStatus.ABORTED:
          case ActionStatus.ABORTING:
            RollbackException rollbackException = new RollbackException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted"));
            if(_theTransaction.getDeferredThrowable() != null) {
              rollbackException.initCause(_theTransaction.getDeferredThrowable());
            }
            throw rollbackException;
          default:
            throw new IllegalStateException(
                jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.invalidstate"));
View Full Code Here

         }

         //2) shall we rollback?
         if (status == Status.STATUS_MARKED_ROLLBACK || status == Status.STATUS_ROLLING_BACK) {
            runRollback();
            throw new RollbackException("Exception rolled back, status is: " + status);
         }

         //3) if we reached this point then we shall go on and commit
         try {
            status = Status.STATUS_COMMITTING;
View Full Code Here

         case Status.STATUS_COMMITTING:
            throw new IllegalStateException("already started committing. " + this);
         case Status.STATUS_COMMITTED:
            throw new IllegalStateException("already committed. " + this);
         case Status.STATUS_MARKED_ROLLBACK:
            throw new RollbackException("already marked for rollback " + this);
         case Status.STATUS_ROLLING_BACK:
            throw new RollbackException("already started rolling back. " + this);
         case Status.STATUS_ROLLEDBACK:
            throw new RollbackException("already rolled back. " + this);
         case Status.STATUS_NO_TRANSACTION:
            throw new IllegalStateException("no transaction. " + this);
         case Status.STATUS_UNKNOWN:
            throw new IllegalStateException("unknown state " + this);
         default:
View Full Code Here

         }

         //2) shall we rollback?
         if (status == Status.STATUS_MARKED_ROLLBACK || status == Status.STATUS_ROLLING_BACK) {
            runRollback();
            throw new RollbackException("Exception rolled back, status is: " + status);
         }

         //3) if we reached this point then we shall go on and commit
         try {
            status = Status.STATUS_COMMITTING;
View Full Code Here

         case Status.STATUS_COMMITTING:
            throw new IllegalStateException("already started committing. " + this);
         case Status.STATUS_COMMITTED:
            throw new IllegalStateException("already committed. " + this);
         case Status.STATUS_MARKED_ROLLBACK:
            throw new RollbackException("already marked for rollback " + this);
         case Status.STATUS_ROLLING_BACK:
            throw new RollbackException("already started rolling back. " + this);
         case Status.STATUS_ROLLEDBACK:
            throw new RollbackException("already rolled back. " + this);
         case Status.STATUS_NO_TRANSACTION:
            throw new IllegalStateException("no transaction. " + this);
         case Status.STATUS_UNKNOWN:
            throw new IllegalStateException("unknown state " + this);
         default:
View Full Code Here

         }

         //2) shall we rollback?
         if (status == Status.STATUS_MARKED_ROLLBACK || status == Status.STATUS_ROLLING_BACK) {
            runRollback();
            throw new RollbackException("Exception rollbacked, status is: " + status);
         }

         //3) if we reached this point then we shall go on and commit
         try {
            status = Status.STATUS_COMMITTING;
View Full Code Here

         case Status.STATUS_COMMITTING:
            throw new IllegalStateException("already started committing. " + this);
         case Status.STATUS_COMMITTED:
            throw new IllegalStateException("already committed. " + this);
         case Status.STATUS_MARKED_ROLLBACK:
            throw new RollbackException("already marked for rollback " + this);
         case Status.STATUS_ROLLING_BACK:
            throw new RollbackException("already started rolling back. " + this);
         case Status.STATUS_ROLLEDBACK:
            throw new RollbackException("already rolled back. " + this);
         case Status.STATUS_NO_TRANSACTION:
            throw new IllegalStateException("no transaction. " + this);
         case Status.STATUS_UNKNOWN:
            throw new IllegalStateException("unknown state " + this);
         default:
View Full Code Here

      Transaction tx = getTransaction();
      if (tx == null)
         throw new IllegalStateException("thread not associated with transaction");
      status = tx.getStatus();
      if (status == Status.STATUS_MARKED_ROLLBACK)
         throw new RollbackException();
      tx.commit();

      // Disassociate tx from thread.
      setTransaction(null);
   }
View Full Code Here

            status = Status.STATUS_ROLLING_BACK;
            doCommit = false;
         }
         notifyAfterCompletion(doCommit ? Status.STATUS_COMMITTED : Status.STATUS_MARKED_ROLLBACK);
         status = doCommit ? Status.STATUS_COMMITTED : Status.STATUS_MARKED_ROLLBACK;
         if (!doCommit) throw new RollbackException("outcome is " + outcome + " status: " + status);
      }
      finally
      {
         // Disassociate tx from thread.
         tm_.setTransaction(null);
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.