Package org.omg.CosTransactions

Examples of org.omg.CosTransactions.Vote


            }
        } else {
            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                try {
                    Vote v = r.prepare();
                    votes.setElementAt(v, i);
                    if (v.value() == Vote._VoteRollback){

                        rollback();
                        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();

                    }
                } catch(HeuristicHazard hh) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicMixed hm) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                }
            }

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }

            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                Vote     v = (Vote)votes.elementAt(i);
               
                try {
                    if (v == null){
                        throw new org.omg.CORBA.INTERNAL();
                    } else {
                        if (v.value() == Vote._VoteCommit){
                            r.commit();
                        }
                    }
                } catch(NotPrepared np) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
View Full Code Here


    }

    private void rolling_to_back(){
        for (int i = 0;i < resources.size();i++){
            Resource r = (Resource)resources.elementAt(i);
            Vote     v = (Vote)votes.elementAt(i);
            try {
                if (v == null){
                    r.rollback();
                } else {
                    if (v.value() == Vote._VoteCommit){
                        r.rollback();
                    }
                }
            } catch(HeuristicCommit hc) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
View Full Code Here

                if (onePhase) {
                    coord.beforeCompletion();
                    if (coord.getParticipantCount() == 1) {
                        coord.commitOnePhase();
                    } else {
                        Vote vote = Vote.VoteRollback;
                        try {
                            vote = coord.prepare();
                        } catch (HeuristicMixed exc) {
                            errorCode = XAException.XA_HEURHAZ;
                            throw new XAException(errorCode);
View Full Code Here

           
            // If there is a Coordinator, lock it for the duration of this
            // operation. Tell the Coordinator to commit.
            synchronized (coord) {
                coord.beforeCompletion();
                Vote vote = coord.prepare();
                if (vote == Vote.VoteRollback) {
                    errorCode = XAException.XA_RBROLLBACK;
                } else if (vote == Vote.VoteCommit) {
                    return XAResource.XA_OK;
                } else if (vote == Vote.VoteReadOnly) {
View Full Code Here

                if (onePhase) {
                    coord.beforeCompletion();
                    if (coord.getParticipantCount() == 1) {
                        coord.commitOnePhase();
                    } else {
                        Vote vote = Vote.VoteRollback;
                        try {
                            vote = coord.prepare();
                        } catch (HeuristicMixed exc) {
                            errorCode = XAException.XA_HEURHAZ;
                            throw new XAException(errorCode);
View Full Code Here

           
            // If there is a Coordinator, lock it for the duration of this
            // operation. Tell the Coordinator to commit.
            synchronized (coord) {
                coord.beforeCompletion();
                Vote vote = coord.prepare();
                if (vote == Vote.VoteRollback) {
                    errorCode = XAException.XA_RBROLLBACK;
                } else if (vote == Vote.VoteCommit) {
                    return XAResource.XA_OK;
                } else if (vote == Vote.VoteReadOnly) {
View Full Code Here

            }
        } else {
            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                try {
                    Vote v = r.prepare();
                    votes.setElementAt(v, i);
                    if (v.value() == Vote._VoteRollback){

                        rollback();
                        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();

                    }
                } catch(HeuristicHazard hh) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicMixed hm) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                }
            }

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }

            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                Vote     v = (Vote)votes.elementAt(i);
               
                try {
                    if (v == null){
                        throw new org.omg.CORBA.INTERNAL();
                    } else {
                        if (v.value() == Vote._VoteCommit){
                            r.commit();
                        }
                    }
                } catch(NotPrepared np) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
View Full Code Here

    }

    private void rolling_to_back(){
        for (int i = 0;i < resources.size();i++){
            Resource r = (Resource)resources.elementAt(i);
            Vote     v = (Vote)votes.elementAt(i);
            try {
                if (v == null){
                    r.rollback();
                } else {
                    if (v.value() == Vote._VoteCommit){
                        r.rollback();
                    }
                }
            } catch(HeuristicCommit hc) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
View Full Code Here

                if (onePhase) {
                    coord.beforeCompletion();
                    if (coord.getParticipantCount() == 1) {
                        coord.commitOnePhase();
                    } else {
                        Vote vote;
                        try {
                            vote = coord.prepare();
                        } catch (HeuristicMixed exc) {
                            errorCode = XAException.XA_HEURHAZ;
                            throw new XAException(errorCode);
View Full Code Here

           
            // If there is a Coordinator, lock it for the duration of this
            // operation. Tell the Coordinator to commit.
            synchronized (coord) {
                coord.beforeCompletion();
                Vote vote = coord.prepare();
                if (vote == Vote.VoteRollback) {
                    errorCode = XAException.XA_RBROLLBACK;
                } else if (vote == Vote.VoteCommit) {
                    return XAResource.XA_OK;
                } else if (vote == Vote.VoteReadOnly) {
View Full Code Here

TOP

Related Classes of org.omg.CosTransactions.Vote

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.