private void Hammertime() { var store = SeparateStore(opts => { opts.Advanced.HiloSequenceDefaults.MaxLo = 5; }); store.BulkInsert(TargetIntId.GenerateRandomData(100).ToArray()); }
private void Hammertime() { using (var store = CreateDocumentStore()) { using (var session = store.OpenSession()) { var targets = TargetIntId.GenerateRandomData(100); session.InsertObjects(targets); session.SaveChanges(); } } }
public void generate_hilo_in_highly_concurrent_scenarios() { // ensure we create required DB objects since the concurrent // test could potentially create the same DB objects at the same time var store = StoreOptions(opts => { opts.Advanced.HiloSequenceDefaults.MaxLo = 5; }); store.BulkInsert(TargetIntId.GenerateRandomData(100).ToArray()); Task.WaitAll(Task.Run(Hammertime), Task.Run(Hammertime), Task.Run(Hammertime), Task.Run(Hammertime)); }
public void generate_hilo_in_highly_concurrent_scenarios() { // ensure we create required DB objects since the concurrent // test could potentially create the same DB objects at the same time var store = CreateDocumentStore(); using (var session = store.OpenSession()) { session.InsertObjects(TargetIntId.GenerateRandomData(1)); session.SaveChanges(); } Task.WaitAll(Task.Run(() => Hammertime()), Task.Run(() => Hammertime()), Task.Run(() => Hammertime()), Task.Run(() => Hammertime())); }