Пример #1
0
        public virtual void Test()
        {
            int[]      ids            = new int[2];
            IObjectSet originalResult = NewQuery(typeof(DeepPrefetchingCacheConcurrencyTestCase.Item
                                                        )).Execute();

            DeepPrefetchingCacheConcurrencyTestCase.Item firstOriginalItem = ((DeepPrefetchingCacheConcurrencyTestCase.Item
                                                                               )originalResult.Next());
            Db().Purge(firstOriginalItem);
            IExtObjectContainer otherClient  = OpenNewSession();
            IObjectSet          updateResult = otherClient.Query(typeof(DeepPrefetchingCacheConcurrencyTestCase.Item
                                                                        ));
            int idx = 0;

            for (IEnumerator updateItemIter = updateResult.GetEnumerator(); updateItemIter.MoveNext
                     ();)
            {
                DeepPrefetchingCacheConcurrencyTestCase.Item updateItem = ((DeepPrefetchingCacheConcurrencyTestCase.Item
                                                                            )updateItemIter.Current);
                ids[idx]         = (int)otherClient.GetID(updateItem);
                updateItem._name = "updated";
                otherClient.Store(updateItem);
                idx++;
            }
            otherClient.Commit();
            otherClient.Close();
            for (int i = 0; i < ids.Length; i++)
            {
                DeepPrefetchingCacheConcurrencyTestCase.Item checkItem = ((DeepPrefetchingCacheConcurrencyTestCase.Item
                                                                           )Db().GetByID(ids[i]));
                Db().Activate(checkItem);
                Assert.AreEqual("updated", checkItem._name);
            }
        }
		/// <exception cref="System.Exception"></exception>
		protected override void Store()
		{
			for (int i = 0; i < 2; i++)
			{
				DeepPrefetchingCacheConcurrencyTestCase.Item item = new DeepPrefetchingCacheConcurrencyTestCase.Item
					("original");
				Store(item);
			}
		}
Пример #3
0
 /// <exception cref="System.Exception"></exception>
 protected override void Store()
 {
     for (int i = 0; i < 2; i++)
     {
         DeepPrefetchingCacheConcurrencyTestCase.Item item = new DeepPrefetchingCacheConcurrencyTestCase.Item
                                                                 ("original");
         Store(item);
     }
 }