예제 #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();
        }
예제 #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();
        }