Examples of INVALID_TRANSACTION


Examples of org.omg.CORBA.INVALID_TRANSACTION

       */

      if (parentTransaction != null)
        parentTransaction.removeChildAction(this);

      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION,
          CompletionStatus.COMPLETED_NO);
    }

    /*
     * Now do after completion stuff.
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::prepare for "+_theUid);
  }

  if (_theControl == null)
  {
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  }

  if (_theControl.isWrapper())
  {
      destroyResource()// won't necessarily get another invocation!
      return Vote.VoteReadOnly;
  }

  ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
 
  //  ThreadActionData.pushAction(theTransaction); // unnecessary if context goes with all calls.

  int result = TwoPhaseOutcome.PREPARE_NOTOK;

  /*
   * Transaction may have locally timed out and been rolled back.
   */

  int s = theTransaction.status();

  if ((s == ActionStatus.RUNNING) || (s == ActionStatus.ABORT_ONLY))
      result = theTransaction.doPrepare();
  else
  {
      switch (s)
      {
      case ActionStatus.COMMITTING:
      case ActionStatus.COMMITTED:
      case ActionStatus.H_COMMIT:
    result = TwoPhaseOutcome.PREPARE_OK;
    break;
      case ActionStatus.H_MIXED:
    result = TwoPhaseOutcome.HEURISTIC_MIXED;
    break;
      case ActionStatus.H_HAZARD:
    result = TwoPhaseOutcome.HEURISTIC_HAZARD;
    break;
      }
  }
   
  ThreadActionData.popAction();

  if (jtsLogger.logger.isDebugEnabled())
  {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::prepare for "+_theUid+" : "+TwoPhaseOutcome.stringForm(result));
  }

  /*
   * If prepare failed, then rollback now.
   */

  if (result == TwoPhaseOutcome.PREPARE_NOTOK)
  {
      try
      {
    rollback();
      }
      catch (HeuristicCommit ex1)
      {
    result = TwoPhaseOutcome.HEURISTIC_COMMIT;
      }
      catch (HeuristicMixed ex2)
      {
    result = TwoPhaseOutcome.HEURISTIC_MIXED;
      }
      catch (HeuristicHazard ex3)
      {
    result = TwoPhaseOutcome.HEURISTIC_HAZARD;
      }
      catch (SystemException ex4)
      {
    result = TwoPhaseOutcome.HEURISTIC_HAZARD;
      }
  }
     
  switch (result)
  {
  case TwoPhaseOutcome.INVALID_TRANSACTION:
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION, CompletionStatus.COMPLETED_NO);
  case TwoPhaseOutcome.PREPARE_OK:
      return Vote.VoteCommit;
  case TwoPhaseOutcome.PREPARE_NOTOK:
      destroyResource()// won't necessarily get another invocation!

View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::rollback for "+_theUid);
  }

  if (_theControl == null)
  {
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  }

  if (_theControl.isWrapper())
  {
      destroyResource();
      return;
  }
 
  ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
 
  //  ThreadActionData.pushAction(theTransaction);

  int actionStatus = theTransaction.status();
   
  if (actionStatus == ActionStatus.PREPARED)
  {
      /*
       * This will also call any after_completions on
       * registered synchronizations.
       */

      actionStatus = theTransaction.doPhase2Abort();
  }
  else
  {
      if ((actionStatus == ActionStatus.RUNNING) ||
                (actionStatus == ActionStatus.ABORT_ONLY))
      {
    try
    {
        /*
         * Have to do this because of the way PI works
         * with thread-context association.
         */

        if (!valid())
      theTransaction.doPhase2Abort()// must rollback
        else
      theTransaction.rollback();

        actionStatus = ActionStatus.ABORTED;
    }
    catch (SystemException ex)
    {
        actionStatus = ActionStatus.ABORTED;

        throw ex;
    }
    finally
    {
        destroyResource();
    }
      }
  }

  ThreadActionData.popAction();

  if (jtsLogger.logger.isDebugEnabled())
  {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::rollback for "+_theUid+" : "+ActionStatus.stringForm(actionStatus));
  }

  switch (actionStatus)
  {
  case ActionStatus.PREPARED:
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION, CompletionStatus.COMPLETED_NO);
  case ActionStatus.ABORTED:
  case ActionStatus.H_ROLLBACK:
      destroyResource();
      break;
  case ActionStatus.COMMITTED:
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit for "+_theUid);
  }

  if (_theControl == null)
  {
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  }
 
  if (_theControl.isWrapper())
  {
      destroyResource();
      return;
  }

  ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
 
  //  ThreadActionData.pushAction(theTransaction);
 
  int actionStatus = theTransaction.status();
  boolean notPrepared = false;

  if (actionStatus == ActionStatus.PREPARED)
  {
      /*
       * This will also call any after_completions on
       * registered synchronizations.
       */
     
      actionStatus = theTransaction.doPhase2Commit();
  }
  else
  {
      if (actionStatus == ActionStatus.RUNNING)
      {
    if (jtsLogger.logger.isDebugEnabled())
    {
        jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
                   com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit for "+_theUid+" : NotPrepared");
    }

    notPrepared = true;
      }
  }

  ThreadActionData.popAction();

  if (notPrepared)
      throw new NotPrepared();

  if (jtsLogger.logger.isDebugEnabled())
  {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
           com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit for "+_theUid+" : "+ActionStatus.stringForm(actionStatus));
  }
 
  switch (actionStatus)
  {
  case ActionStatus.PREPARED:
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  case ActionStatus.COMMITTED:
  case ActionStatus.H_COMMIT:
      destroyResource();
      break;
  case ActionStatus.ABORTED:
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit_one_phase for "+_theUid);
  }

  if (_theControl == null)
  {
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  }

  if (_theControl.isWrapper())
  {
      destroyResource();
      return;
  }

  ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();

  if (theTransaction == null)
  {
      if (jtsLogger.loggerI18N.isWarnEnabled())
      {
    jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.notx",
            new Object[] {"ServerTopLevelAction.commit_one_phase"});
      }

      throw new INVALID_TRANSACTION(ExceptionCodes.NO_TRANSACTION, CompletionStatus.COMPLETED_NO);
  }
 
  //  ThreadActionData.pushAction(theTransaction);

  try
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

      if (jtsLogger.logger.isDebugEnabled())
      {
        jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerControlWrapper::create_subtransaction - subtransaction parent is inactive.");
      }

      throw new INVALID_TRANSACTION(
          ExceptionCodes.UNAVAILABLE_COORDINATOR,
          CompletionStatus.COMPLETED_NO);
    }
  }
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

    if (registerIn.add(corbaRec) != AddOutcome.AR_ADDED)
    {
      corbaRec = null;

      throw new INVALID_TRANSACTION(ExceptionCodes.ADD_FAILED,
          CompletionStatus.COMPLETED_NO);
    }
    else
    {
      if (jtsLogger.logger.isDebugEnabled())
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

    if (determineStatus(this) != Status.StatusPrepared)
    {
      if (!preventCommit())
      {
        throw new INVALID_TRANSACTION(
            ExceptionCodes.INACTIVE_TRANSACTION,
            CompletionStatus.COMPLETED_NO);
      }
    }
    else
View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::prepare for "+_theUid);
  }

  if (_theControl == null)
  {
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  }

  if (_theControl.isWrapper())
  {
      destroyResource()// won't necessarily get another invocation!
      return Vote.VoteReadOnly;
  }

  ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();

  //  ThreadActionData.pushAction(theTransaction); // unnecessary if context goes with all calls.

  int result = TwoPhaseOutcome.PREPARE_NOTOK;

  /*
   * Transaction may have locally timed out and been rolled back.
   */

  int s = theTransaction.status();

  if ((s == ActionStatus.RUNNING) || (s == ActionStatus.ABORT_ONLY))
      result = theTransaction.doPrepare();
  else
  {
      switch (s)
      {
      case ActionStatus.COMMITTING:
      case ActionStatus.COMMITTED:
      case ActionStatus.H_COMMIT:
    result = TwoPhaseOutcome.PREPARE_OK;
    break;
      case ActionStatus.H_MIXED:
    result = TwoPhaseOutcome.HEURISTIC_MIXED;
    break;
      case ActionStatus.H_HAZARD:
    result = TwoPhaseOutcome.HEURISTIC_HAZARD;
    break;
      }
  }

  ThreadActionData.popAction();

  if (jtsLogger.logger.isDebugEnabled())
  {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::prepare for "+_theUid+" : "+TwoPhaseOutcome.stringForm(result));
  }

  /*
   * If prepare failed, then rollback now.
   */

  if (result == TwoPhaseOutcome.PREPARE_NOTOK)
  {
      try
      {
    rollback();
      }
      catch (HeuristicCommit ex1)
      {
    result = TwoPhaseOutcome.HEURISTIC_COMMIT;
      }
      catch (HeuristicMixed ex2)
      {
    result = TwoPhaseOutcome.HEURISTIC_MIXED;
      }
      catch (HeuristicHazard ex3)
      {
    result = TwoPhaseOutcome.HEURISTIC_HAZARD;
      }
      catch (SystemException ex4)
      {
    result = TwoPhaseOutcome.HEURISTIC_HAZARD;
      }
  }

  switch (result)
  {
  case TwoPhaseOutcome.INVALID_TRANSACTION:
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION, CompletionStatus.COMPLETED_NO);
  case TwoPhaseOutcome.PREPARE_OK:
      return Vote.VoteCommit;
  case TwoPhaseOutcome.PREPARE_NOTOK:
      destroyResource()// won't necessarily get another invocation!

View Full Code Here

Examples of org.omg.CORBA.INVALID_TRANSACTION

                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::rollback for "+_theUid);
  }

  if (_theControl == null)
  {
      throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
  }

  if (_theControl.isWrapper())
  {
      destroyResource();
      return;
  }

  ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();

  //  ThreadActionData.pushAction(theTransaction);

  int actionStatus = theTransaction.status();

  if (actionStatus == ActionStatus.PREPARED)
  {
      /*
       * This will also call any after_completions on
       * registered synchronizations.
       */

      actionStatus = theTransaction.doPhase2Abort();
  }
  else
  {
      if ((actionStatus == ActionStatus.RUNNING) ||
                (actionStatus == ActionStatus.ABORT_ONLY))
      {
    try
    {
        /*
         * Have to do this because of the way PI works
         * with thread-context association.
         */

        if (!valid())
      theTransaction.doPhase2Abort()// must rollback
        else
      theTransaction.rollback();

        actionStatus = ActionStatus.ABORTED;
    }
    catch (SystemException ex)
    {
        actionStatus = ActionStatus.ABORTED;

        throw ex;
    }
    finally
    {
        destroyResource();
    }
      }
  }

  ThreadActionData.popAction();

  if (jtsLogger.logger.isDebugEnabled())
  {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
                 com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::rollback for "+_theUid+" : "+ActionStatus.stringForm(actionStatus));
  }

  switch (actionStatus)
  {
  case ActionStatus.PREPARED:
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION, CompletionStatus.COMPLETED_NO);
  case ActionStatus.ABORTED:
  case ActionStatus.H_ROLLBACK:
      destroyResource();
      break;
  case ActionStatus.COMMITTED:
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.