Package javax.transaction

Examples of javax.transaction.HeuristicRollbackException


        synchronized (this) {
            status = Status.STATUS_COMMITTED;
        }
        if (cause != null) {
            if (cause.errorCode == XAException.XA_HEURRB && !evercommit) {
                throw (HeuristicRollbackException) new HeuristicRollbackException("Error during two phase commit").initCause(cause);
            } else if (cause.errorCode == XAException.XA_HEURRB && evercommit) {
                throw (HeuristicMixedException) new HeuristicMixedException("Error during two phase commit").initCause(cause);
            } else if (cause.errorCode == XAException.XA_HEURMIX) {
                throw (HeuristicMixedException) new HeuristicMixedException("Error during two phase commit").initCause(cause);
            } else {
View Full Code Here


                        case ActionStatus.COMMITTING:
                                break;
                        case ActionStatus.ABORTED:
                        case ActionStatus.ABORTING:
                        case ActionStatus.H_ROLLBACK:
                                throw new HeuristicRollbackException();
                        case ActionStatus.H_HAZARD:
                        case ActionStatus.H_MIXED:
                            throw new HeuristicMixedException();
                        case ActionStatus.INVALID:
                                throw new IllegalStateException();
View Full Code Here

                        {
                        case ActionStatus.ABORTED:
                        case ActionStatus.ABORTING:
                            break;
                        case ActionStatus.H_ROLLBACK:
                            throw new HeuristicRollbackException();
                        case ActionStatus.COMMITTED:
                        case ActionStatus.COMMITTING:
                        case ActionStatus.H_COMMIT:
                                throw new HeuristicCommitException();
                        case ActionStatus.H_HAZARD:
View Full Code Here

         case XAException.XA_HEURHAZ:
         case XAException.XA_HEURMIX:
            throw new HeuristicMixedException("Heuristic mixed result of transaction " + this);
        
         case XAException.XA_HEURRB:
            throw new HeuristicRollbackException("Heuristic rollback of transaction " + this);
      }
   }
View Full Code Here

         switch (e.getOutcomeState())
         {
            case HeuristicCompletionException.STATE_ROLLED_BACK:
               log.error("Exception cause:", e);
               throw new HeuristicRollbackException(e.getMessage());
            default:
               log.error("Exception cause:", e);
               throw new HeuristicMixedException(e.getMessage());
         }
      }
View Full Code Here

/*     */       case 12:
/* 175 */         removeTransaction(this);
/* 176 */         break;
/*     */       case 2:
/*     */       case 4:
/* 179 */         throw new HeuristicRollbackException();
/*     */       case 11:
/* 181 */         throw new HeuristicRollbackException();
/*     */       case 13:
/*     */       case 14:
/* 184 */         throw new HeuristicMixedException();
/*     */       case 9:
/* 186 */         removeTransaction(this);
View Full Code Here

/*     */       case 10:
/*     */       case 11:
/*     */       case 13:
/*     */       case 14:
/*     */       default:
/* 287 */         throw new HeuristicRollbackException();
/*     */       case 9:
/* 289 */         throw new IllegalStateException();
/*     */       }
/*     */     }
/*     */     catch (ClassCastException ex)
View Full Code Here

  public void testJtaTransactionManagerWithHeuristicRollbackExceptionOnCommit() throws Exception {
    UserTransaction ut = mock(UserTransaction.class);
    given(ut.getStatus()).willReturn(Status.STATUS_NO_TRANSACTION,
        Status.STATUS_ACTIVE, Status.STATUS_ACTIVE);
    willThrow(new HeuristicRollbackException("heuristic exception")).given(ut).commit();

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

                        case ActionStatus.COMMITTING:
                                break;
                        case ActionStatus.ABORTED:
                        case ActionStatus.ABORTING:
                        case ActionStatus.H_ROLLBACK:
                                throw new HeuristicRollbackException();
                        case ActionStatus.H_HAZARD:
                        case ActionStatus.H_MIXED:
                            throw new HeuristicMixedException();
                        case ActionStatus.INVALID:
                                throw new IllegalStateException();
View Full Code Here

                        {
                        case ActionStatus.ABORTED:
                        case ActionStatus.ABORTING:
                            break;
                        case ActionStatus.H_ROLLBACK:
                            throw new HeuristicRollbackException();
                        case ActionStatus.COMMITTED:
                        case ActionStatus.COMMITTING:
                        case ActionStatus.H_COMMIT:
                                throw new HeuristicCommitException();
                        case ActionStatus.H_HAZARD:
View Full Code Here

TOP

Related Classes of javax.transaction.HeuristicRollbackException

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.