Package org.omg.CORBA

Examples of org.omg.CORBA.TRANSACTION_ROLLEDBACK


      }
      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


           */

          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:
          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:
            handleForget() ;
            throw new TRANSACTION_ROLLEDBACK();
          case XAException.XAER_NOTA:
          case XAException.XAER_PROTO:
            break;
          case XAException.XAER_INVAL:
          case XAException.XAER_RMFAIL: // resource manager failed,
View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
  }
 
  InterposedHierarchy newElement = new InterposedHierarchy((ServerOSITopLevelAction) 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(OTIDMap.find(ctx.parents[i].otid),
                  tmpCoord, tmpTerm, control);
     
    nestedAction = new ServerOSINestedAction(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
        {
      ((ServerOSINestedAction) nestedAction).rollback_subtransaction()// does dispose as well!
      nestedAction = null;
        }
        catch (Exception e)
        {
        }
   
        throw new TRANSACTION_ROLLEDBACK();
    }

    /*
     * Add transaction resource to list.
     */

    action.addChild((ServerOSINestedAction) 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(OTIDMap.find(ctx.current.otid),
                    tmpCoord, tmpTerm, control);
 
      nestedAction = new ServerOSINestedAction(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
    {
        ((ServerOSINestedAction) nestedAction).rollback_subtransaction()// does dispose as well!
        nestedAction = null;
    }
    catch (Exception e)
    {
    }
     
    throw new TRANSACTION_ROLLEDBACK();
      }
 
      action.addChild((ServerOSINestedAction) nestedAction);
  }

View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
        }

        currentAction.addChild((ServerOSINestedAction) nestedAction);
        currentAction = nestedAction;
    }
      }
      else
      {
    /*
     * Hierarchies may be identical.
     * Remember to check!
     */
      }
 
      Uid currentUid = OTIDMap.find(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 ServerOSINestedAction(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
        {
      ((ServerOSINestedAction) nestedAction).rollback()// does dispose as well!
      nestedAction = null;
        }
        catch (Exception e)
        {
        }

        throw new TRANSACTION_ROLLEDBACK();
    }
   
    currentAction.addChild((ServerOSINestedAction) nestedAction);
      }
      else
View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
  }
 
  InterposedHierarchy newElement = new InterposedHierarchy(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

    case ActionStatus.H_COMMIT:
    case ActionStatus.COMMITTING: // in case asynchronous commit!
      return;
    case ActionStatus.ABORTED:
    case ActionStatus.H_ROLLBACK:
      throw new TRANSACTION_ROLLEDBACK(ExceptionCodes.FAILED_TO_COMMIT,
          CompletionStatus.COMPLETED_NO);
    case ActionStatus.H_HAZARD:
    default:
      throw new HeuristicHazard();
    }
View Full Code Here

      }
      catch (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
  }
   
  InterposedHierarchy newElement = new InterposedHierarchy((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 (Exception e)
      {
      }

      throw new TRANSACTION_ROLLEDBACK();
        }

        currentAction.addChild((ServerNestedAction) 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 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()// does dispose as well!
      nestedAction = null;
        }
        catch (Exception e)
        {
        }

        throw new TRANSACTION_ROLLEDBACK();
    }
   
    currentAction.addChild((ServerNestedAction) nestedAction);
      }
      else
View Full Code Here

            mappedException = new MARSHAL(MAPEXCEPTION_CODE,
                CompletionStatus.COMPLETED_MAYBE);
        } else if ( exception instanceof javax.transaction.TransactionRolledbackException
            || exception instanceof TransactionRolledbackLocalException )
        {
            mappedException = new TRANSACTION_ROLLEDBACK(MAPEXCEPTION_CODE,
                CompletionStatus.COMPLETED_MAYBE);
        } else if ( exception instanceof javax.transaction.TransactionRequiredException
            || exception instanceof TransactionRequiredLocalException )
        {
            mappedException = new TRANSACTION_REQUIRED(MAPEXCEPTION_CODE,
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.