Package org.omg.CORBA

Examples of org.omg.CORBA.TRANSACTION_ROLLEDBACK


    }
    else
    if (_resourceBehavior.commitonephase_behavior == CommitOnePhaseBehavior.CommitOnePhaseBehaviorRaiseTransactionRolledback)
    {
      System.err.println("RaiseTransactionRolledback");
      throw new TRANSACTION_ROLLEDBACK();
    }

    System.err.println("Return");
  }
View Full Code Here


    }
    else
    if (_resourceBehavior.commitonephase_behavior == CommitOnePhaseBehavior.CommitOnePhaseBehaviorRaiseTransactionRolledback)
    {
      System.err.println("RaiseTransactionRolledback");
      throw new TRANSACTION_ROLLEDBACK();
    }

    System.err.println("Return");
  }
View Full Code Here

                        throw cause;
                    }
                }
            } catch (TransactionRolledbackException e) {
                log.debug("TransactionRolledbackException", e);
                throw new TRANSACTION_ROLLEDBACK(e.toString());
            } catch (TransactionRequiredException e) {
                log.debug("TransactionRequiredException", e);
                throw new TRANSACTION_REQUIRED(e.toString());
            } catch (InvalidTransactionException e) {
                log.debug("InvalidTransactionException", e);
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

      }
      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

      }
      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((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

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.