Package com.atomikos.icatch

Examples of com.atomikos.icatch.HeurMixedException


                        + getCoordinator ().getLocalSiblingCount () + " vs "
                        + globalSiblingCount_ + " - forcing rollback." );
                super.rollback ( getCoordinator().isRecoverableWhileActive().booleanValue() , false );

            } catch ( HeurCommitException hc ) {
                throw new HeurMixedException ( hc.getHeuristicMessages() );
            }

            throw new RollbackException ( "Orphans detected." );
        }

        try {
          try {
            getCoordinator().setState ( TxState.PREPARING );
          } catch ( RuntimeException error ) {
            //See case 23334
            String msg = "Error in preparing: " + error.getMessage() + " - rolling back instead";
            LOGGER.logWarning ( msg , error );
            try {
          super.rollback ( getCoordinator().isRecoverableWhileActive().booleanValue() , false );
          throw new RollbackException ( msg );
            } catch ( HeurCommitException e ) {
          LOGGER.logWarning ( "Illegal heuristic commit during rollback before prepare:" + e );
          throw new HeurMixedException ( e.getHeuristicMessages() );
        }
          }
            count = participants.size ();
            result = new PrepareResult ( count );
            Enumeration enumm = participants.elements ();
View Full Code Here


                if ( err instanceof RollbackException ) {
                    // happens during 1pc if tx was rolled back already
                    rolledback = true;
                } else if ( err instanceof HeurMixedException ) {
                    heurmixed = true;
                    HeurMixedException hm = (HeurMixedException) err;
                    addErrorMessages ( hm.getHeuristicMessages () );
                    heuristicparticipants_.put ( reply.getParticipant (),
                            TxState.HEUR_MIXED );
                } else if ( err instanceof HeurCommitException ) {
                    heurcommits = true;
                    HeurCommitException hc = (HeurCommitException) err;
View Full Code Here

            throws HeurRollbackException, HeurMixedException,
            HeurHazardException, java.lang.IllegalStateException,
            RollbackException, SysException
    {

        throw new HeurMixedException ( getHeuristicMessages () );
    }
View Full Code Here

    protected HeuristicMessage[] rollback () throws HeurCommitException,
            HeurMixedException, SysException, HeurHazardException,
            java.lang.IllegalStateException
    {

        throw new HeurMixedException ( getHeuristicMessages () );
    }
View Full Code Here

                readonly = false;

                Exception err = reply.getException ();
                if ( err instanceof HeurMixedException ) {
                    heurmixed = true;
                    HeurMixedException hm = (HeurMixedException) err;
                    addMessages ( hm.getHeuristicMessages () );
                } else if ( err instanceof HeurCommitException ) {
                    heurcommits = true;
                    HeurCommitException hc = (HeurCommitException) err;
                    addMessages ( hc.getHeuristicMessages () );
                    heurmixed = (heurmixed || heurhazards);
View Full Code Here

            try {
          rollback ( getCoordinator().isRecoverableWhileActive().booleanValue() , false );
          throw new RollbackException ( msg );
            } catch ( HeurCommitException e ) {
          LOGGER.logWarning ( "Illegal heuristic commit during rollback:" + e );
          throw new HeurMixedException ( e.getHeuristicMessages() );
        }
          }


            // start messages
            Enumeration enumm = participants.elements ();
            while ( enumm.hasMoreElements () ) {
                Participant p = (Participant) enumm.nextElement ();
                if ( !readOnlyTable_.containsKey ( p ) ) {
                    CommitMessage cm = new CommitMessage ( p, commitresult,
                            onePhase );

                    // if onephase: set cascadelist anyway, because if the
                    // participant is a REMOTE one, then it might have
                    // multiple participants that are not visible here!

                    if ( onePhase && cascadeList_ != null ) { // null for OTS
                        Integer sibnum = (Integer) cascadeList_.get ( p );
                        if ( sibnum != null ) // null for local participant!
                            p.setGlobalSiblingCount ( sibnum.intValue () );
                        p.setCascadeList ( cascadeList_ );
                    }
                    propagator_.submitPropagationMessage ( cm );
                }
            } // while

            commitresult.waitForReplies ();
            int res = commitresult.getResult ();

            if ( res != TerminationResult.ALL_OK ) {

                if ( res == TerminationResult.HEUR_MIXED ) {
                    Hashtable hazards = commitresult.getPossiblyIndoubts ();
                    Hashtable heuristics = commitresult
                            .getHeuristicParticipants ();
                    addToHeuristicMap ( heuristics );
                    enumm = participants.elements ();
                    while ( enumm.hasMoreElements () ) {
                        Participant p = (Participant) enumm.nextElement ();
                        if ( !heuristics.containsKey ( p ) )
                            addToHeuristicMap ( p, TxState.TERMINATED );
                    }
                    nextStateHandler = new HeurMixedStateHandler ( this,
                            hazards );

                    coordinator_.setStateHandler ( nextStateHandler );
                    throw new HeurMixedException ( getHeuristicMessages () );
                }

                else if ( res == TerminationResult.ROLLBACK ) {
                    // 1PC and rolled back before commit arrived.
                    nextStateHandler = new TerminatedStateHandler ( this );
View Full Code Here

                            addToHeuristicMap ( p, TxState.TERMINATED );
                    }
                    nextStateHandler = new HeurMixedStateHandler ( this,
                            hazards );
                    coordinator_.setStateHandler ( nextStateHandler );
                    throw new HeurMixedException ( getHeuristicMessages () );
                }

                else if ( res == TerminationResult.HEUR_COMMIT ) {
                    nextStateHandler = new HeurCommittedStateHandler ( this );
                    coordinator_.setStateHandler ( nextStateHandler );
View Full Code Here

            throws HeurRollbackException, HeurMixedException,
            HeurHazardException, java.lang.IllegalStateException,
            RollbackException, SysException
    {

        throw new HeurMixedException ( getHeuristicMessages () );
    }
View Full Code Here

              HeurHazardException, IllegalStateException {
            return rollbackFromWithinCallback(getCoordinator().isRecoverableWhileActive().booleanValue(),false);
          }});

            } catch ( HeurCommitException hc ) {
                throw new HeurMixedException ( hc.getHeuristicMessages() );
            }

            throw new RollbackException ( "Orphans detected." );
        }

        try {
          try {
            getCoordinator().setState ( TxState.PREPARING );
          } catch ( RuntimeException error ) {
            //See case 23334
            String msg = "Error in preparing: " + error.getMessage() + " - rolling back instead";
            LOGGER.logWarning ( msg , error );
            try {
          rollbackWithAfterCompletionNotification(new RollbackCallback() {
            public HeuristicMessage[] doRollback()
                throws HeurCommitException,
                HeurMixedException, SysException,
                HeurHazardException, IllegalStateException {
              return rollbackFromWithinCallback(getCoordinator().isRecoverableWhileActive().booleanValue(),false);
            }});
          throw new RollbackException ( msg , error);
            } catch ( HeurCommitException e ) {
          LOGGER.logWarning ( "Illegal heuristic commit during rollback before prepare:" + e );
          throw new HeurMixedException ( e.getHeuristicMessages() );
        }
          }
            count = participants.size ();
            result = new PrepareResult ( count );
            Enumeration enumm = participants.elements ();
View Full Code Here

                 connection.transactionTerminated ( true );
             } catch ( Exception e ) {
                 Configuration.logWarning ( "Error in non-XA commit", e );
                 //see case 30752: don't throw HAZARD because retries are probably useless
                 //and the connection won't be reused by the pool but destroyed instead
                 throw new HeurMixedException ( getHeuristicMessages () );
             }
        }
       
      
View Full Code Here

TOP

Related Classes of com.atomikos.icatch.HeurMixedException

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.