public void CompareString(int compArraySize) { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(1); CompareByField<AllSupported> compareByField = new CompareByField<AllSupported>("aString", session); BTreeSet<AllSupported> sortedSet = new BTreeSet<AllSupported>(compareByField, session, 1000, (ushort) compArraySize); for (int i = 0; i < 10000; i++) { obj = new AllSupported(1); obj.aString = RandomString(10); sortedSet.Add(obj); } obj = new AllSupported(1); obj.aString = null; sortedSet.Add(obj); int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable<AllSupported>)sortedSet) { if (prior != null) { if (prior.aString != null) if (currentObj.aString == null) Assert.Fail("Null is < than a non NULL"); else Assert.Less(prior.aString, currentObj.aString); } prior = currentObj; ct++; } session.Commit(); } }
public void fullShiftRightTest() { Oid id; int ct = 0; using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); BTreeSet <int> bTree = new BTreeSet <int>(null, session, 9); session.Persist(bTree); id = bTree.Oid; for (int i = 65; i >= 0; i -= 5) { bTree.Add(i); ct++; } bTree.Remove(65); ct--; bTree.Remove(60); ct--; bTree.Remove(55); ct--; bTree.Remove(50); ct--; bTree.Add(1); ct++; bTree.Add(2); ct++; bTree.Add(3); ct++; bTree.Add(4); ct++; session.Commit(); } using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginRead(); BTreeSet <int> bTree = (BTreeSet <int>)session.Open(id); int count = 0; foreach (int num in bTree) { count++; } Assert.True(ct == bTree.Count); Assert.True(ct == bTree.Count()); session.Commit(); } }
public void Bug2Test() { using (SessionNoServer session = new SessionNoServer(systemDir)) { const ushort nodeMaxSize = 5000; const ushort comparisonByteArraySize = sizeof(Int32); // enough room to hold entire idNumber of a Person const bool comparisonArrayIsCompleteKey = true; const bool addIdCompareIfEqual = false; session.BeginUpdate(); //mySession.SetTraceAllDbActivity(); CompareByField <Entity> compareByField = new CompareByField <Entity>("idNumber", session, addIdCompareIfEqual); BTreeSet <Entity> bTree = new BTreeSet <Entity>(compareByField, session, nodeMaxSize, comparisonByteArraySize, comparisonArrayIsCompleteKey); Placement place = new Placement(40); bTree.Persist(place, session); for (int i = 0; i < 5; i++) { var x = new Entity(); x.idNumber = 250000; x.UserID = 100116; x.FirstName = "Bill"; x.LastName = "Martin"; x.MiddleName = "Bob"; if (!bTree.Contains(x)) { x.Persist(place, session); bTree.Add(x); } } Assert.IsTrue(bTree.Count == 1); session.Commit(); } }
static void CreateData() { using (SessionNoServer session = new SessionNoServer(s_systemDir)) { bool dirExist = Directory.Exists(session.SystemDirectory); if (dirExist) { return; Directory.Delete(session.SystemDirectory, true); // remove systemDir from prior runs and all its databases. } Directory.CreateDirectory(session.SystemDirectory); File.Copy(s_licenseDbFile, Path.Combine(session.SystemDirectory, "4.odb")); SessionBase.DefaultCompressPages = PageInfo.compressionKind.LZ4; session.BeginUpdate(); CompareGeoObj comparer = new CompareGeoObj(); var btreeSet = new BTreeSet<GeoObj>(comparer, session, 1000); for (int i = 0; i < s_numberOfSamples; i++) { var g = new GeoObj(); btreeSet.Add(g); } session.Persist(btreeSet); session.Commit(); Console.Out.WriteLine($@"Done creating {s_numberOfSamples} GeoHashSample GeoObj "); } }
public void CompareInt32Descending() { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(2, session); CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("int32", session, false, false, false); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1, session); obj.int32 = randGen.Next(Int32.MinValue, Int32.MaxValue); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { Assert.Greater(prior.int32, currentObj.int32); } prior = currentObj; ct++; } session.Commit(); } }
/// <summary> /// Internally sets a property value /// </summary> /// <param name="element">element id</param> /// <param name="aValue">value</param> virtual protected void SetPropertyValueX(ElementId element, T aValue) { Update(); m_propertyValue[element] = aValue; if (m_valueIndex != null) { BTreeSet <ElementId> oidArray; if (!m_valueIndex.TryGetKey(aValue, ref aValue)) { oidArray = new BTreeSet <ElementId>(null, Session); oidArray.Add(element); m_valueIndex.AddFast(aValue, oidArray); } else { oidArray = m_valueIndex[aValue]; oidArray.Add(element); m_valueIndex[aValue] = oidArray; } } else if (m_valueIndexUnique != null) { m_valueIndexUnique.AddFast(aValue, element); } }
public void CreateTicksCompareFields(int numberOfTicks, int nodeSize) { using (SessionNoServer session = new SessionNoServer(systemDir, 2000, false)) { //session.SetTraceAllDbActivity(); session.BeginUpdate(); CompareByField <Tick> compareByField = new CompareByField <Tick>("<Bid>k__BackingField", session, true); //compareByField.AddFieldToCompare("<Timestamp>k__BackingField"); BTreeSet <Tick> bTree = new BTreeSet <Tick>(compareByField, session, (UInt16)nodeSize, sizeof(double) + sizeof(UInt64), true); Placement place = new Placement((UInt32)numberOfTicks, 1, 1, UInt16.MaxValue, UInt16.MaxValue); Placement ticksPlace = new Placement((UInt32)numberOfTicks, 10000, 1, UInt16.MaxValue, UInt16.MaxValue); bTree.Persist(place, session); int i = 0; int dublicates = 0; foreach (var record in Tick.GenerateRandom((ulong)numberOfTicks)) { session.Persist(record, ticksPlace); if (bTree.Add(record)) { i++; } else { dublicates++; } } session.Commit(); Console.WriteLine("Done creating and sorting with BTreeSet<Tick> " + i + " Tick objects by Bid value. Number of dublicates (not added to BTreeSet): " + dublicates); } }
public void CompareInt64() { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(2, session); CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("int64", session); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000, sizeof(Int64), true); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1, session); obj.int64 = randGen.Next(Int32.MinValue, Int32.MaxValue) * randGen.Next(); sortedSet.Add(obj); } int ct = 0; //foreach (AllSupported currentObj in (IEnumerable<AllSupported>)sortedSet) // { // Console.WriteLine(currentObj.int32); // ct++; // } AllSupported prior = null; ct = 0; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { Assert.Less(prior.int64, currentObj.int64); } prior = currentObj; ct++; } session.Commit(); } }
static void CreateData() { using (SessionNoServer session = new SessionNoServer(s_systemDir)) { bool dirExist = Directory.Exists(session.SystemDirectory); if (dirExist) { return; Directory.Delete(session.SystemDirectory, true); // remove systemDir from prior runs and all its databases. } Directory.CreateDirectory(session.SystemDirectory); File.Copy(s_licenseDbFile, Path.Combine(session.SystemDirectory, "4.odb")); SessionBase.DefaultCompressPages = PageInfo.compressionKind.LZ4; session.BeginUpdate(); CompareGeoObj comparer = new CompareGeoObj(); var btreeSet = new BTreeSet <GeoObj>(comparer, session, 1000); for (int i = 0; i < s_numberOfSamples; i++) { var g = new GeoObj(); btreeSet.Add(g); } session.Persist(btreeSet); session.Commit(); Console.Out.WriteLine($@"Done creating {s_numberOfSamples} GeoHashSample GeoObj "); } }
public void CompareDateTime() { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj; CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("dateTime", session); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000, sizeof(long), true); for (int i = 0; i < 20000; i++) { obj = new AllSupported(1); obj.dateTime = DateTime.FromBinary(randGen.Next(Int32.MinValue, Int32.MaxValue) * randGen.Next()); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { Assert.Less(prior.dateTime, currentObj.dateTime); } prior = currentObj; ct++; } session.Commit(); } }
public void CompareInt32DescendingComparisonArray() { #if DEBUG Assert.Throws <NotImplementedException>(() => { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(2); CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("int32", session, false, false, false); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000, sizeof(Int32), true); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1); obj.int32 = randGen.Next(Int32.MinValue, Int32.MaxValue); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { Assert.Greater(prior.int32, currentObj.int32); } prior = currentObj; ct++; } session.Commit(); } }); #endif }
public void CompareInt16() { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(1); CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("int16", session); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000, sizeof(Int16), true); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1); obj.int16 = (Int16)randGen.Next(Int16.MinValue, Int16.MaxValue); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { Assert.Less(prior.int16, currentObj.int16); } prior = currentObj; ct++; } session.Commit(); } }
public void hashCodeComparerStringTest() { Oid id; using (SessionNoServer session = new SessionNoServer(systemDir)) { Placement place = new Placement(223, 1, 1, UInt16.MaxValue, UInt16.MaxValue); session.Compact(); session.BeginUpdate(); HashCodeComparer <string> hashCodeComparer = new HashCodeComparer <string>(); BTreeSet <string> bTree = new BTreeSet <string>(hashCodeComparer, session); bTree.Persist(place, session); id = bTree.Oid; for (int i = 0; i < 100000; i++) { bTree.Add(i.ToString()); } session.Commit(); } using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginRead(); BTreeSet <string> bTree = (BTreeSet <string>)session.Open(id); int count = 0; foreach (string str in bTree) { count++; } Assert.True(100000 == count); session.Commit(); } }
public void hashCodeComparerStringTest() { Oid id; using (SessionNoServer session = new SessionNoServer(systemDir)) { Placement place = new Placement(223, 1, 1, UInt16.MaxValue, UInt16.MaxValue); session.Compact(); session.BeginUpdate(); HashCodeComparer<string> hashCodeComparer = new HashCodeComparer<string>(); BTreeSet<string> bTree = new BTreeSet<string>(hashCodeComparer, session); bTree.Persist(place, session); id = bTree.Oid; for (int i = 0; i < 100000; i++) { bTree.Add(i.ToString()); } session.Commit(); } using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginRead(); BTreeSet<string> bTree= (BTreeSet<string>)session.Open(id); int count = 0; foreach (string str in bTree) { count++; } Assert.True(100000 == count); session.Commit(); } }
void SetPropertyValueX(ElementId element, T aValue) { Update(); propertyValue[element] = aValue; if (valueIndex != null) { BTreeSet <ElementId> oidArray; if (!valueIndex.TryGetKey(aValue, ref aValue)) { oidArray = new BTreeSet <ElementId>(null, graph.Session); oidArray.Add(element); valueIndex.AddFast(aValue, oidArray); } else { oidArray = valueIndex[aValue]; oidArray.Add(element); valueIndex[aValue] = oidArray; } } else if (valueIndexUnique != null) { valueIndexUnique.AddFast(aValue, element); } }
public void CreateDefaultCompareFailException() { using (SessionNoServer session = new SessionNoServer(systemDir)) { Man aMan; Woman aWoman; session.BeginUpdate(); BTreeSet <Person> bTree = new BTreeSet <Person>(null, session); for (int i = 0; i < 1000000; i++) { aMan = new Man(); aWoman = new Woman(); bTree.Add(aMan); bTree.Add(aWoman); } session.Commit(); } }
public void CompareString(int compArraySize) { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(1); CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("aString", session); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000, (ushort)compArraySize); for (int i = 0; i < 10000; i++) { obj = new AllSupported(1); obj.aString = RandomString(10); sortedSet.Add(obj); } obj = new AllSupported(1); obj.aString = null; sortedSet.Add(obj); int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { if (prior.aString != null) { if (currentObj.aString == null) { Assert.Fail("Null is < than a non NULL"); } else { Assert.Less(prior.aString, currentObj.aString); } } } prior = currentObj; ct++; } session.Commit(); } }
public void AddInteraction(Interaction interaction) { if (m_interactions == null) { m_interactions = new BTreeSet <Interaction>(); } if (m_interactions.Add(interaction)) { var reference = new Reference(m_interactions, "m_interactions"); interaction.References.AddFast(reference); // may be possible to automatize setting reference } }
public void CreateDefaultCompare() { using (SessionNoServer session = new SessionNoServer(systemDir)) { Man aMan = new Man(); Woman aWoman = new Woman(); session.BeginUpdate(); BTreeSet <Person> bTree = new BTreeSet <Person>(null, session); session.Persist(bTree); for (int i = 0; i < 50000; i++) { aMan = new Man(); aMan.Persist(session, aMan); aWoman = new Woman(); aWoman.Persist(session, aWoman); bTree.Add(aMan); Assert.AreEqual(bTree.GetKeyId(aMan), aMan.Id); bTree.Add(aWoman); } session.Commit(); } }
public void SortedObjectsSample() { Oid bTreeId; using (SessionNoServer session = new SessionNoServer(systemDir)) { const UInt32 numberOfPersons = 100000; const ushort nodeMaxSize = 5000; const ushort comparisonByteArraySize = sizeof(UInt64); // enough room to hold entire idNumber of a Person const bool comparisonArrayIsCompleteKey = true; const bool addIdCompareIfEqual = false; VelocityDbSchema.Samples.AllSupportedSample.Person person; session.BeginUpdate(); //mySession.SetTraceAllDbActivity(); CompareByField <VelocityDbSchema.Samples.AllSupportedSample.Person> compareByField = new CompareByField <VelocityDbSchema.Samples.AllSupportedSample.Person>("m_idNumber", session, addIdCompareIfEqual); BTreeSet <VelocityDbSchema.Samples.AllSupportedSample.Person> bTree = new BTreeSet <VelocityDbSchema.Samples.AllSupportedSample.Person>(compareByField, session, nodeMaxSize, comparisonByteArraySize, comparisonArrayIsCompleteKey); session.Persist(bTree); // Persist the root of the BTree so that we have something persisted that can be flushed to disk if memory available becomes low for (int i = 0; i < numberOfPersons; i++) { person = new VelocityDbSchema.Samples.AllSupportedSample.Person(); session.Persist(person); bTree.Add(person); } bTreeId = bTree.Oid; session.Commit(); } using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginRead(); BTreeSet <VelocityDbSchema.Samples.AllSupportedSample.Person> bTree = (BTreeSet <VelocityDbSchema.Samples.AllSupportedSample.Person>)session.Open(bTreeId); foreach (VelocityDbSchema.Samples.AllSupportedSample.Person person in (IEnumerable <VelocityDbSchema.Samples.AllSupportedSample.Person>)bTree) { if (person.IdNumber > 196988888791402) { Console.WriteLine(person); break; } } session.Commit(); session.BeginRead(); // this LINQ statement will trigger a binary search lookup (not a linear serach) of the matching Person objects in the BTreeSet Console.WriteLine((from person in bTree where person.IdNumber > 196988888791402 select person).First()); session.Commit(); } }
public void CompareDouble(bool completeKey) { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(1); CompareByField <AllSupported> compareByField = new CompareByField <AllSupported>("aDouble", session); BTreeSet <AllSupported> sortedSet = new BTreeSet <AllSupported>(compareByField, session, 1000, sizeof(double), completeKey); List <AllSupported> toRemove = new List <AllSupported>(); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1); obj.aDouble = (randGen.NextDouble() - randGen.NextDouble()) * randGen.Next(UInt16.MinValue, UInt16.MaxValue); if (i % 3500 == 0) { toRemove.Add(obj); } sortedSet.Add(obj); } session.Commit(); session.BeginUpdate(); foreach (AllSupported r in toRemove) { sortedSet.Remove(r); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable <AllSupported>)sortedSet) { if (prior != null) { Assert.Less(prior.aDouble, currentObj.aDouble); } prior = currentObj; ct++; } session.Commit(); } }
public void CompareInt32DescendingComparisonArray() { #if DEBUG Assert.Throws<NotImplementedException>(() => { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(2); CompareByField<AllSupported> compareByField = new CompareByField<AllSupported>("int32", session, false, false, false); BTreeSet<AllSupported> sortedSet = new BTreeSet<AllSupported>(compareByField, session, 1000, sizeof(Int32), true); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1); obj.int32 = randGen.Next(Int32.MinValue, Int32.MaxValue); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable<AllSupported>)sortedSet) { if (prior != null) Assert.Greater(prior.int32, currentObj.int32); prior = currentObj; ct++; } session.Commit(); } }); #endif }
public void CompareDouble(bool completeKey) { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(1); CompareByField<AllSupported> compareByField = new CompareByField<AllSupported>("aDouble", session); BTreeSet<AllSupported> sortedSet = new BTreeSet<AllSupported>(compareByField, session, 1000, sizeof(double), completeKey); List<AllSupported> toRemove = new List<AllSupported>(); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1); obj.aDouble = (randGen.NextDouble() - randGen.NextDouble()) * randGen.Next(UInt16.MinValue, UInt16.MaxValue); if (i % 3500 == 0) toRemove.Add(obj); sortedSet.Add(obj); } session.Commit(); session.BeginUpdate(); foreach (AllSupported r in toRemove) sortedSet.Remove(r); int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable<AllSupported>)sortedSet) { if (prior != null) Assert.Less(prior.aDouble, currentObj.aDouble); prior = currentObj; ct++; } session.Commit(); } }
public void CompareDateTime() { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj; CompareByField<AllSupported> compareByField = new CompareByField<AllSupported>("dateTime", session); BTreeSet<AllSupported> sortedSet = new BTreeSet<AllSupported>(compareByField, session, 1000, sizeof(long), true); for (int i = 0; i < 20000; i++) { obj = new AllSupported(1); obj.dateTime = DateTime.FromBinary(randGen.Next(Int32.MinValue, Int32.MaxValue) * randGen.Next()); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable<AllSupported>)sortedSet) { if (prior != null) Assert.Less(prior.dateTime, currentObj.dateTime); prior = currentObj; ct++; } session.Commit(); } }
public void CompareInt16() { using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); AllSupported obj = new AllSupported(1); CompareByField<AllSupported> compareByField = new CompareByField<AllSupported>("int16", session); BTreeSet<AllSupported> sortedSet = new BTreeSet<AllSupported>(compareByField, session, 1000, sizeof(Int16), true); for (int i = 0; i < 100000; i++) { obj = new AllSupported(1); obj.int16 = (Int16) randGen.Next(Int16.MinValue, Int16.MaxValue); sortedSet.Add(obj); } int ct = 0; AllSupported prior = null; foreach (AllSupported currentObj in (IEnumerable<AllSupported>)sortedSet) { if (prior != null) Assert.Less(prior.int16, currentObj.int16); prior = currentObj; ct++; } session.Commit(); } }
public void CreateDefaultCompareFailException() { using (SessionNoServer session = new SessionNoServer(systemDir)) { Man aMan; Woman aWoman; session.BeginUpdate(); BTreeSet<Person> bTree = new BTreeSet<Person>(null, session); for (int i = 0; i < 1000000; i++) { aMan = new Man(); aWoman = new Woman(); bTree.Add(aMan); bTree.Add(aWoman); } session.Commit(); } }
public void CreateTicksCompareFields(int numberOfTicks, int nodeSize) { using (SessionNoServer session = new SessionNoServer(systemDir, 2000, false)) { //session.SetTraceAllDbActivity(); session.BeginUpdate(); CompareByField<Tick> compareByField = new CompareByField<Tick>("<Bid>k__BackingField", session, true); //compareByField.AddFieldToCompare("<Timestamp>k__BackingField"); BTreeSet<Tick> bTree = new BTreeSet<Tick>(compareByField, session, (UInt16) nodeSize, sizeof(double) + sizeof(UInt64), true); Placement place = new Placement((UInt32)numberOfTicks, 1, 1, UInt16.MaxValue, UInt16.MaxValue); Placement ticksPlace = new Placement((UInt32)numberOfTicks, 10000, 1, UInt16.MaxValue, UInt16.MaxValue); bTree.Persist(place, session); int i = 0; int dublicates = 0; foreach (var record in Tick.GenerateRandom((ulong) numberOfTicks)) { session.Persist(record, ticksPlace); if (bTree.Add(record)) i++; else dublicates++; } session.Commit(); Console.WriteLine("Done creating and sorting with BTreeSet<Tick> " + i + " Tick objects by Bid value. Number of dublicates (not added to BTreeSet): " + dublicates); } }
public void CreateDefaultCompare() { using (SessionNoServer session = new SessionNoServer(systemDir)) { Man aMan = new Man(); Woman aWoman = new Woman(); session.BeginUpdate(); BTreeSet<Person> bTree = new BTreeSet<Person>(null, session); session.Persist(bTree); for (int i = 0; i < 50000; i++) { aMan = new Man(); aMan.Persist(session, aMan); aWoman = new Woman(); aWoman.Persist(session, aWoman); bTree.Add(aMan); Assert.AreEqual(bTree.GetKeyId(aMan), aMan.Id); bTree.Add(aWoman); } session.Commit(); } }