Package org.omg.CORBA

Examples of org.omg.CORBA.TRANSACTION_ROLLEDBACK


      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
  }

  ServerTopLevelAction newElement = (ServerStrictTopLevelAction)action;

  _head.add(newElement);

  if (depth > 0// current is a nested transaction
  {
      /*
       * Now deal with any nested transactions.
       * As we create, register with the original transactions.
       */

      ServerResource nestedAction = null;

      for (int i = depth -2; i >= 0; i--)
      {
    tmpCoord = ctx.parents[i].coord;
    tmpTerm = ctx.parents[i].term;

    control = ServerFactory.create_subtransaction(Utility.otidToUid(ctx.parents[i].otid),
                  tmpCoord, tmpTerm, control);

    nestedAction = new ServerStrictNestedAction(control, false)// not current, so don't register

    if (!nestedAction.valid())
    {
        /*
         * Just deal with current transaction. Others must have been
         * registered successfully, and will be deal with automatically
         * when the parent transaction terminates.
         */

        try
        {
      ((ServerStrictNestedAction) nestedAction).rollback_subtransaction()// does dispose as well!
      nestedAction = null;
        }
        catch (Exception e)
        {
        }

        throw new TRANSACTION_ROLLEDBACK();
    }

    /*
     * Add transaction resource to list.
     */

    action.addChild((ServerStrictNestedAction) nestedAction);
    action = nestedAction;
      }

      /*
       * Now deal with current transaction. If there is
       * only one transaction we do nothing.
       */

      tmpCoord = ctx.current.coord;
      tmpTerm = ctx.current.term;

      control = ServerFactory.create_subtransaction(Utility.otidToUid(ctx.current.otid),
                    tmpCoord, tmpTerm, control);

      nestedAction = new ServerStrictNestedAction(control, true)// current, so register

      if (!nestedAction.valid())
      {
    /*
     * Just deal with current transaction. Others must have been
     * registered successfully, and will be deal with automatically
     * when the parent transaction terminates.
     */

    try
    {
        ((ServerStrictNestedAction) nestedAction).rollback_subtransaction()// does dispose as well!
        nestedAction = null;
    }
    catch (Exception e)
    {
    }

    throw new TRANSACTION_ROLLEDBACK();
      }

      action.addChild((ServerStrictNestedAction) nestedAction);
  }

View Full Code Here


      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
        }

        currentAction.addChild((ServerStrictNestedAction) nestedAction);
        currentAction = nestedAction;
    }
      }
      else
      {
    /*
     * Hierarchies may be identical.
     * Remember to check!
     */
      }

      Uid currentUid = Utility.otidToUid(context.current.otid);

      /*
       * currentAction points to the parent of the 'current'
       * transaction, i.e., the last element in the TransIdentity
       * structure. So, ask it if the sent hierarchy's child is
       * one of its children.
       */

      nestedAction = currentAction.getChild(currentUid);

      if (nestedAction == null)
      {
    /*
     * Different notion of current in sent hierarchy.
     * So, add it to the hierarchy here.
     */

    control = currentAction.control();

    /*
     * Now deal with the current transaction.
     */

    TransIdentity currentID = context.current;

    control = ServerFactory.create_subtransaction(currentUid, currentID.coord, currentID.term, control);

    nestedAction = new ServerStrictNestedAction(control, true);

    if (!nestedAction.valid())
    {
        /*
         * Just deal with current transaction. Others must have been
         * registered successfully, and will be deal with automatically
         * when the parent transaction terminates.
         */

        try
        {
      ((ServerStrictNestedAction) nestedAction).rollback()// does dispose as well!
      nestedAction = null;
        }
        catch (Exception e)
        {
        }

        throw new TRANSACTION_ROLLEDBACK();
    }

    currentAction.addChild((ServerStrictNestedAction) nestedAction);
      }
      else
View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
  }

  ServerTopLevelAction newElement = (ServerTopLevelAction)action;

  _head.add(newElement);

  if (depth > 0) // current is a nested transaction
  {
      /*
       * Now deal with any nested transactions.
       * As we create, register with the original transactions.
       */

      ServerResource nestedAction = null;

      for (int i = depth -2; i >= 0; i--)
      {
    tmpCoord = ctx.parents[i].coord;
    tmpTerm = ctx.parents[i].term;

    control = ServerFactory.create_subtransaction(Utility.otidToUid(ctx.parents[i].otid),
                  tmpCoord, tmpTerm, control);

    nestedAction = new ServerNestedAction(control);

    if (!nestedAction.valid())
    {
        /*
         * Just deal with current transaction. Others must have been
         * registered successfully, and will be deal with automatically
         * when the parent transaction terminates.
         */

        try
        {
      ((ServerNestedAction) nestedAction).rollback_subtransaction()// does dispose as well!
      nestedAction = null;
        }
        catch (Exception e)
        {
        }

        throw new TRANSACTION_ROLLEDBACK();
    }

    /*
     * Add transaction resource to list.
     */

    action.addChild((ServerNestedAction) nestedAction);
    action = nestedAction;
      }

      /*
       * Now deal with current transaction. If there is
       * only one transaction we do nothing.
       */

      tmpCoord = ctx.current.coord;
      tmpTerm = ctx.current.term;

      control = ServerFactory.create_subtransaction(Utility.otidToUid(ctx.current.otid),
                    tmpCoord, tmpTerm, control);

      nestedAction = new ServerNestedAction(control);

      if (!nestedAction.valid())
      {
    /*
     * Just deal with current transaction. Others must have been
     * registered successfully, and will be deal with automatically
     * when the parent transaction terminates.
     */

    try
    {
        ((ServerNestedAction) nestedAction).rollback_subtransaction()// does dispose as well!
        nestedAction = null;
    }
    catch (Exception e)
    {
    }

    throw new TRANSACTION_ROLLEDBACK();
      }

      action.addChild((ServerNestedAction) nestedAction);
  }

View Full Code Here

    catch (NullPointerException ex// if local handle is null then it was terminated (probably by reaper)
    {
        // check termination status
       
        if (_controlImpl.getFinalStatus() != org.omg.CosTransactions.Status.StatusCommitted)
                        throw new TRANSACTION_ROLLEDBACK();
    }
  }
View Full Code Here

          throw new Unavailable();
      }
    }
    catch (NullPointerException ex)
    {
      throw new TRANSACTION_ROLLEDBACK();
    }
  }
View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
  }

  ServerTopLevelAction newElement = tlAction;

  super._head.add(newElement);

  if (depth > 0) // current is a nested transaction
  {
      /*
       * Now deal with any nested transactions.
       * As we create, register with the original transactions.
       */

      ServerRestrictedNestedAction nestedAction = null;

      for (int i = depth -2; i >= 0; i--)
      {
    tmpCoord = ctx.parents[i].coord;
    tmpTerm = ctx.parents[i].term;

    control = ServerFactory.create_subtransaction(Utility.otidToUid(ctx.parents[i].otid),
                  tmpCoord, tmpTerm, control);

    nestedAction = new ServerRestrictedNestedAction(control);

    if (!nestedAction.valid())
    {
        /*
         * Just deal with current transaction. Others must have been
         * registered successfully, and will be deal with automatically
         * when the parent transaction terminates.
         */

        try
        {
      nestedAction.rollback();
      nestedAction = null;
        }
        catch (Exception e)
        {
        }

        throw new TRANSACTION_ROLLEDBACK();
    }

    /*
     * Add transaction resource to list.
     */

    tlAction.addChild(nestedAction);
      }

      /*
       * Now deal with current transaction. If there is only one transaction we do nothing.
       */

      tmpCoord = ctx.current.coord;
      tmpTerm = ctx.current.term;

      control = ServerFactory.create_subtransaction(Utility.otidToUid(ctx.current.otid),
                    tmpCoord, tmpTerm, control);
      nestedAction = new ServerRestrictedNestedAction(control);

      if (!nestedAction.valid())
      {
    /*
     * Just deal with current transaction. Others must have been
     * registered successfully, and will be deal with automatically
     * when the parent transaction terminates.
     */

    try
    {
        nestedAction.rollback();
        nestedAction = null;
    }
    catch (Exception e)
    {
    }

    throw new TRANSACTION_ROLLEDBACK();
      }

      tlAction.addChild(nestedAction);
  }

View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
        }

        tlAction.addChild(nestedAction);
    }

    nestedAction = null;
      }
      else
      {
    if (nestedAction != null)
    {
        /*
         * If current transaction has a child then we should
         * abort it, since it does not exist in the hierarchy
         * we have just received.
         */

        nestedAction = nestedAction.child();

        if (nestedAction != null)
        {
      tlAction.abortChild(nestedAction);
      nestedAction = null;
      control = tlAction.deepestControl();
        }
    }
      }
  }

  boolean newCurrent = false;
  Uid sentCurrent = Utility.otidToUid(context.current.otid);

  /*
   * If differentIndex is not -1 then we already found a difference
   * between the sent hierarchy and the one we already had, so we
   * must have a new current.
   */

  if (differenceIndex == -1)
  {
      /*
       * Now determine whether we have to create any new nested actions.
       */

      Uid currentUid = null;

      /*
       * Get hold of our local notion of current.
       */

      if (nestedAction == null)
      {
    nestedAction = tlAction.child();

    if (nestedAction != null)
    {
        while (nestedAction.child() != null)
      nestedAction = nestedAction.child();

        currentUid = nestedAction.get_uid();
    }
    else
        currentUid = tlAction.get_uid();
      }
      else
    currentUid = nestedAction.get_uid();

      /*
       * Is our notion of the current transaction the same as
       * that sent?
       */

      if (currentUid.notEquals(sentCurrent))
      {
    newCurrent = true;
      }
  }
  else
      newCurrent = true;

  if (newCurrent)
  {
      if (depth == 1)
      {
    /*
     * Old current is gone.
     */

    nestedAction = tlAction.child();

    if (nestedAction != null)
    {
        tlAction.abortChild(nestedAction);
        nestedAction = null;
    }

    control = (ServerControl) tlAction.control();
      }
      else
    control = tlAction.deepestControl();

      TransIdentity currentID = context.current;

      control = ServerFactory.create_subtransaction(sentCurrent,
                    currentID.coord, currentID.term, control);
      nestedAction = new ServerRestrictedNestedAction(control);

      if (!nestedAction.valid())
      {
    /*
     * Just deal with current transaction. Others must have been
     * registered successfully, and will be deal with automatically
     * when the parent transaction terminates.
     */

    try
    {
        nestedAction.rollback()// does dispose as well!
        nestedAction = null;
    }
    catch (Exception e)
    {
    }

    throw new TRANSACTION_ROLLEDBACK();
      }

      tlAction.addChild(nestedAction);

      nestedAction = null;
View Full Code Here

                            // RM unexpectedly lost track of the tx, outcome is uncertain
                            updateState(TwoPhaseOutcome.HEURISTIC_HAZARD);
                throw new org.omg.CosTransactions.HeuristicHazard();
              case XAException.XAER_PROTO:
                            // presumed abort (or we could be really paranoid and throw a heuristic)
                            throw new TRANSACTION_ROLLEDBACK();

            case XAException.XA_RETRY:
                _committed = true// remember for recovery later.
              throw new UNKNOWN()// will cause log to be rewritten.
            case XAException.XAER_INVAL:
View Full Code Here

                      "com.arjuna.ats.internal.jta.resources.jts.orbspecific.nulltransaction",
                      new Object[]
                                 { "XAResourceRecord.commit_one_phase" });
          }

          throw new TRANSACTION_ROLLEDBACK();
      }
      else
      {
          if (_theXAResource != null)
          {
              try
              {
                  switch (_heuristic)
                  {
                  case TwoPhaseOutcome.HEURISTIC_HAZARD:
                      throw new org.omg.CosTransactions.HeuristicHazard();
                  default:
                      break;
                  }

                  /*
                   * TODO in Oracle, the end is not required. Is this
                   * common to other RM implementations?
                   */

                  boolean commit = true;

                  try
                  {
                      if (endAssociation())
                      {
                          _theXAResource.end(_tranID, XAResource.TMSUCCESS);
                      }
                  }
                  catch (XAException e1)
                  {
                      /*
                       * Now it's not legal to return a heuristic from end, but
                       * apparently Oracle does (http://jira.jboss.com/jira/browse/JBTM-343)
                       * Since this is 1PC we can call forget: the outcome of the
                       * transaction is the outcome of the participant.
                       */

                      switch (e1.errorCode)
                      {
                      case XAException.XA_HEURHAZ:
                      case XAException.XA_HEURMIX:
                      case XAException.XA_HEURCOM:
                      case XAException.XA_HEURRB:
                          throw e1;
                      case XAException.XA_RBROLLBACK:
                      case XAException.XA_RBCOMMFAIL:
                      case XAException.XA_RBDEADLOCK:
                      case XAException.XA_RBINTEGRITY:
                      case XAException.XA_RBOTHER:
                      case XAException.XA_RBPROTO:
                      case XAException.XA_RBTIMEOUT:
                      case XAException.XA_RBTRANSIENT:
                          /*
                           * Has been marked as rollback-only. We still
                           * need to call rollback.
                           */

                          commit = false;
                          break;
                      case XAException.XAER_RMERR:
                      case XAException.XAER_NOTA:
                      case XAException.XAER_PROTO:
                      case XAException.XAER_INVAL:
                      case XAException.XAER_RMFAIL:
                      default:
                      {
                          throw new UNKNOWN();
                      }
                      }
                  }

                  _theXAResource.commit(_tranID, true);
              }
              catch (XAException e1)
              {
                  /*
                   * XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX,
                   * XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
                   * XAER_PROTO. XA_RB*
                   */

                  if ((e1.errorCode >= XAException.XA_RBBASE)
                          && (e1.errorCode <= XAException.XA_RBEND))
                  {
                      throw new TRANSACTION_ROLLEDBACK();
                  }

                  switch (e1.errorCode)
                  {
                  case XAException.XA_HEURHAZ:
                  case XAException.XA_HEURMIX:
                      updateState(TwoPhaseOutcome.HEURISTIC_HAZARD);

                      throw new org.omg.CosTransactions.HeuristicHazard();
                  case XAException.XA_HEURCOM:
                      handleForget() ;
                      break;
                  case XAException.XA_HEURRB:
                         handleForget() ;
                         throw new TRANSACTION_ROLLEDBACK();
                  case XAException.XA_RBROLLBACK:
                  case XAException.XA_RBCOMMFAIL:
                  case XAException.XA_RBDEADLOCK:
                  case XAException.XA_RBINTEGRITY:
                  case XAException.XA_RBOTHER:
                  case XAException.XA_RBPROTO:
                  case XAException.XA_RBTIMEOUT:
                  case XAException.XA_RBTRANSIENT:
                  case XAException.XAER_RMERR:
                      throw new TRANSACTION_ROLLEDBACK();
                  case XAException.XAER_NOTA:
                      // RM unexpectedly lost track of the tx, outcome is uncertain
                      updateState(TwoPhaseOutcome.HEURISTIC_HAZARD);
                      throw new org.omg.CosTransactions.HeuristicHazard();
                  case XAException.XAER_PROTO:
                  case XAException.XA_RETRY:  // not allowed to be thrown here by XA specification!
                      // presumed abort (or we could be really paranoid and throw a heuristic)
                      throw new TRANSACTION_ROLLEDBACK();

                  case XAException.XAER_INVAL:
                  case XAException.XAER_RMFAIL: // resource manager failed,
                      // did it rollback?
                      throw new org.omg.CosTransactions.HeuristicHazard();
                  default:
                      _committed = true// will cause log to be rewritten

                  throw new UNKNOWN();
                  }
              }
              catch (SystemException ex)
              {
                  ex.printStackTrace();

                  throw ex;
              }
              catch (org.omg.CosTransactions.HeuristicHazard ex)
              {
                  throw ex;
              }
              catch (Exception e2)
              {
                  if (jtaLogger.loggerI18N.isWarnEnabled())
                  {
                      jtaLogger.loggerI18N
                      .warn(
                              "com.arjuna.ats.internal.jta.resources.jts.orbspecific.coperror",
                              new Object[] {e2}, e2);
                  }

                  throw new UNKNOWN();
              }
              finally
              {
                  removeConnection();
              }
          }
          else
              throw new TRANSACTION_ROLLEDBACK();
      }
  }
View Full Code Here

    case ActionStatus.COMMITTING: // in case asynchronous commit!
      return;
    case ActionStatus.ABORTED:
    case ActionStatus.ABORTING:  // in case of asynchronous abort!
    case ActionStatus.H_ROLLBACK:
      throw new TRANSACTION_ROLLEDBACK(ExceptionCodes.FAILED_TO_COMMIT,
          CompletionStatus.COMPLETED_NO);
    case ActionStatus.H_MIXED:
      throw new HeuristicMixed();
    case ActionStatus.H_HAZARD:
    default:
View Full Code Here

TOP

Related Classes of org.omg.CORBA.TRANSACTION_ROLLEDBACK

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.