public void testArray() { LocalCache cache = new LocalCache(); cache.Clear(); cache.AddIndex(IdentityExtractor.Instance, false, null); DoPutALL doDoPutAll = new DoPutALL(cache, "array"); lock (doDoPutAll.m_myLock) { Thread thread = new Thread(new ThreadStart(doDoPutAll.Run)); thread.Start(); Thread.Sleep(2222); ArrayList qname = new ArrayList(); qname.Add("test"); IFilter filter = new ContainsAnyFilter(IdentityExtractor.Instance, (ICollection)qname); for (int i = 0; i < 50000; i++) { object[] result = cache.GetEntries(filter); Assert.AreEqual(result.Length, cache.Count); } // signal the PutAll thread to stop Monitor.Wait(doDoPutAll.m_myLock); thread.Join(); } }
/// <summary> /// Removes all elements from the <b>IDictionary</b> object. /// </summary> public virtual void Clear() { LocalCache.Clear(); }
public void Clear() { db.SessionValues.DeleteAllOnSubmit(db.SessionValues.Where(v => v.SessionId == CurrentSessionId)); db.SubmitChanges(); LocalCache.Clear(); }