Exemplo n.º 1
0
        /// <summary>
        /// Aborts a transaction on this server
        /// </summary>
        /// <param name="tid">transaction identifier</param>
        /// <param name="usedPadInts">Identifiers of PadInts involved</param>
        /// <returns>A predicate confirming the sucess of the operations</returns>
        public bool Abort(int tid, List <int> usedPadInts)
        {
            Logger.Log(new String[] { "Server", ID.ToString(), "abort", "tid", tid.ToString(), serverState.StateMsg });

            try {
                return(serverState.Abort(tid, usedPadInts));
            }
            catch (PadIntNotFoundException) {
                throw;
            }
            catch (ServerDoesNotReplyException) {
                throw;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Aborts a transaction on this server
        /// </summary>
        /// <param name="tid">transaction identifier</param>
        /// <param name="usedPadInts">Identifiers of PadInts involved</param>
        /// <returns>A predicate confirming the sucess of the operations</returns>
        internal override bool Abort(int tid, List <int> usedPadInts)
        {
            Logger.Log(new String[] { "FreezedServer", Server.ID.ToString(), "abort", "tid", tid.ToString() });
            bool result;

            lock (this) {
                while (!recover)
                {
                    Monitor.Wait(this);
                }
                result = oldState.Abort(tid, usedPadInts);
                Monitor.Pulse(this);
            }
            return(result);
        }