Ejemplo n.º 1
0
        public void PessimisticConcurrency()
        {
            userFactory.SelectType(UserType.DatabaseAdmin);
            AbstractUser amdin = userFactory.Get();

            userFactory.SelectType(UserType.BreweryOwner);
            AbstractUser owner = userFactory.Get();

            amdin.Work();
            owner.Work();
        }
Ejemplo n.º 2
0
        public void OptimicticConcurrency()
        {
            userFactory.SelectType(UserType.BrewerFirst);
            AbstractUser first = userFactory.Get();

            userFactory.SelectType(UserType.BrewerSecondd);
            AbstractUser second = userFactory.Get();

            first.Work();
            second.Work();
        }