Examples of RollbackException


Examples of javax.transaction.RollbackException

         }

         //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

Examples of javax.transaction.RollbackException

         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

Examples of javax.transaction.RollbackException

      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

Examples of javax.transaction.RollbackException

            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

Examples of javax.transaction.RollbackException

         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

Examples of javax.transaction.RollbackException

      if (tx == null)
         throw new SystemException();

      if (tx.getStatus() == Status.STATUS_ROLLEDBACK ||
          tx.getStatus() == Status.STATUS_MARKED_ROLLBACK)
         throw new RollbackException();

      registry.endTransaction();
   }
View Full Code Here

Examples of javax.transaction.RollbackException

      if (tx == null)
         throw new SystemException();

      if (tx.getStatus() == Status.STATUS_ROLLEDBACK ||
          tx.getStatus() == Status.STATUS_MARKED_ROLLBACK)
         throw new RollbackException();

      registry.endTransaction();
   }
View Full Code Here

Examples of javax.transaction.RollbackException

        } catch (XAException e) {

            if (e.errorCode >= XAException.XA_RBBASE &&
                    e.errorCode <= XAException.XA_RBEND) {
                throw new RollbackException("Transaction rolled back: " +
                        "XA_ERR=" + e.errorCode);
            } else {
                throw new SystemException("Unable to commit transaction: " +
                        "XA_ERR=" + e.errorCode);
            }
View Full Code Here

Examples of javax.transaction.RollbackException

    @Test( expected = RuntimeException.class )
    public void commitWithRollbackException()
        throws Exception
    {
        doThrow( new RollbackException() ).when( txn ).commit();
        sut.commit();
    }
View Full Code Here

Examples of javax.transaction.RollbackException

        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
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.