public void PessimisticConcurrency() { userFactory.SelectType(UserType.DatabaseAdmin); AbstractUser amdin = userFactory.Get(); userFactory.SelectType(UserType.BreweryOwner); AbstractUser owner = userFactory.Get(); amdin.Work(); owner.Work(); }
public void OptimicticConcurrency() { userFactory.SelectType(UserType.BrewerFirst); AbstractUser first = userFactory.Get(); userFactory.SelectType(UserType.BrewerSecondd); AbstractUser second = userFactory.Get(); first.Work(); second.Work(); }