Package javax.transaction

Examples of javax.transaction.RollbackException


      {
        throw new javax.transaction.HeuristicMixedException();
      }
      catch (TRANSACTION_ROLLEDBACK e4)
      {
        throw new RollbackException(e4.toString());
      }
      catch (org.omg.CORBA.NO_PERMISSION e5)
      {
        throw new SecurityException();
      }
View Full Code Here


    int status = getStatus();

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

      {
        throw new javax.transaction.HeuristicMixedException();
      }
      catch (TRANSACTION_ROLLEDBACK e4)
      {
        RollbackException rollbackException = new RollbackException(e4.toString());
                if(_rollbackOnlyCallerStacktrace != null) {
                    // we rolled back beacuse the user explicitly told us not to commit. Attach the trace of who did that for debug:
                    rollbackException.initCause(_rollbackOnlyCallerStacktrace);
                }
                throw rollbackException;
      }
      catch (org.omg.CORBA.NO_PERMISSION e5)
      {
View Full Code Here

  protected void doRegisterAfterCompletionWithJtaTransaction(JtaTransactionObject txObject, List synchronizations)
      throws RollbackException, SystemException {

    int jtaStatus = txObject.getUserTransaction().getStatus();
    if (jtaStatus == Status.STATUS_NO_TRANSACTION) {
      throw new RollbackException("JTA transaction already completed - probably rolled back");
    }
    if (jtaStatus == Status.STATUS_ROLLEDBACK) {
      throw new RollbackException("JTA transaction already rolled back (probably due to a timeout)");
    }

    if (this.transactionSynchronizationRegistry != null) {
      // JTA 1.1 TransactionSynchronizationRegistry available - use it.
      new InterposedSynchronizationDelegate().registerInterposedSynchronization(
View Full Code Here

    ut.getStatus();
    utControl.setReturnValue(Status.STATUS_ACTIVE, 2);
    ut.begin();
    utControl.setVoidCallable(1);
    ut.commit();
    utControl.setThrowable(new RollbackException("unexpected rollback"));
    utControl.replay();

    try {
      JtaTransactionManager ptm = newJtaTransactionManager(ut);
      TransactionTemplate tt = new TransactionTemplate(ptm);
View Full Code Here

    assertFalse(manager.getJoined());
    assertFalse(manager.getRollbackOnly());
  }

  public void testNewTransactionWithCommitException() {
    final RollbackException rex = new RollbackException();
    MockUOWManager manager = new MockUOWManager() {
      public void runUnderUOW(int type, boolean join, UOWAction action) throws UOWException {
        throw new UOWException(rex);
      }
    };
View Full Code Here

    utControl.setReturnValue(Status.STATUS_MARKED_ROLLBACK, 2);
    ut.begin();
    utControl.setVoidCallable(1);
    ut.setRollbackOnly();
    utControl.setVoidCallable(1);
    RollbackException rex = new RollbackException();
    ut.commit();
    utControl.setThrowable(rex, 1);
    utControl.replay();

    MockControl sfControl = MockControl.createControl(SessionFactory.class);
View Full Code Here

            this.status = Status.STATUS_COMMITTED;

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

     */
    public void registerSynchronization(Synchronization sync)
        throws RollbackException, IllegalStateException, SystemException {
       
        if (status == Status.STATUS_MARKED_ROLLBACK)
            throw new RollbackException();
       
        if (status != Status.STATUS_ACTIVE)
            throw new IllegalStateException();
       
        synchronizationObjects.addElement(sync);
View Full Code Here

     */
    public void registerSynchronization(Synchronization sync)
        throws RollbackException, IllegalStateException, SystemException {
       
        if (status == Status.STATUS_MARKED_ROLLBACK)
            throw new RollbackException();
       
        if (status != Status.STATUS_ACTIVE)
            throw new IllegalStateException();
       
        synchronizationObjects.addElement(sync);
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.