Package org.omg.CORBA

Examples of org.omg.CORBA.INVALID_TRANSACTION


    synchronized (_theStatus)
    {
      if (_theAction != null)
      {
        throw new INVALID_TRANSACTION(ExceptionCodes.ALREADY_BEGUN,
            CompletionStatus.COMPLETED_NO);
      }

      _theAction = current.getControlWrapper();
    }
View Full Code Here


    {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ExplicitInterposition::unregisterTransaction ()");
    }

    if (!_inUse)
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION,
          CompletionStatus.COMPLETED_NO);
    else
    {
      try
      {
View Full Code Here

      throw new InterpositionFailed();
    }

    if ((ctx == null) || (ctx.current.coord == null)) // invalid
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION,
          CompletionStatus.COMPLETED_NO);

    _inUse = true;

    TransactionFactoryImple _localFactory = OTSImpleManager.factory();
View Full Code Here

      {
    jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.nullcontrol_1",
                new Object[] {"ServerNestedAction.commit_subtransaction"});
      }

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

  if (_theControl.isWrapper())
  {
      destroyResource();
View Full Code Here

      {
    jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.nullcontrol_2",
            new Object[] {"ServerNestedAction.rollback_subtransaction"});
      }

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

  if (_theControl.isWrapper())
  {
      destroyResource();
View Full Code Here

                 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

                 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

                 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(false);
  }
  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

                 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

       */

      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

TOP

Related Classes of org.omg.CORBA.INVALID_TRANSACTION

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.