示例#1
0
        public bool commit(int txID, List <string> participants)
        {
            if (Datastore.STATE.Equals(State.FAILED))
            {
                return(false);
            }

            bool success = Datastore.Commit(txID, participants);

            return(success);
        }
示例#2
0
        public bool accessPadInt(int uid)
        {
            if (Datastore.STATE.Equals(State.FAILED))
            {
                return(false);
            }

            bool success = Datastore.checkServerObject(uid);

            return(success);
        }
示例#3
0
        public bool createPadInt(int uid, int txID, string clientURL)
        {
            if (Datastore.STATE.Equals(State.FAILED))
            {
                return(false);
            }

            while (Datastore.STATE.Equals(State.FREEZE))
            {
                Datastore.Freeze();
            }

            bool success = Datastore.createServerObject(uid, txID, clientURL);

            return(success);
        }
示例#4
0
        public int Read(int uid, int txID, string clientURL)
        {
            while (Datastore.STATE.Equals(State.FREEZE))
            {
                Console.WriteLine("SERVER FREEZED!");
                Datastore.Freeze();
            }

            if (Datastore.STATE.Equals(State.FAILED))
            {
                return(Int32.MinValue);
            }

            int val = Datastore.regTentativeRead(uid, txID, clientURL);

            return(val);
        }
示例#5
0
        public void Write(int uid, int txID, int newVal, string clientURL)
        {
            if (Datastore.STATE.Equals(State.FAILED))
            {
                throw new ServerFailedException();
            }

            bool success = Datastore.regTentativeWrite(uid, newVal, txID, clientURL);

            if (!success)
            {
                Console.WriteLine("ABORTED TRANSACTION=" + txID);
                IEndTransaction client = (IEndTransaction)Activator.GetObject(
                    typeof(IEndTransaction), clientURL + "EndTransaction");
                client.abort();
            }
            return;
        }
示例#6
0
 public void haveCommitted(int txID, string url)
 {
     Datastore.haveCommitted(txID, url);
 }
示例#7
0
 public void sendNo(int txID, string url)
 {
     Datastore.participantVoteYes(txID, url);
 }
示例#8
0
 public void doAbort(int txID, string coordURL)
 {
     Datastore.doAbort(txID, coordURL);
 }
示例#9
0
 public void canCommit(int txID, string coordURL)
 {
     Datastore.canCommit(txID, coordURL);
 }