Example #1
0
        private void Hammertime()
        {
            var store = SeparateStore(opts =>
            {
                opts.Advanced.HiloSequenceDefaults.MaxLo = 5;
            });

            store.BulkInsert(TargetIntId.GenerateRandomData(100).ToArray());
        }
Example #2
0
 private void Hammertime()
 {
     using (var store = CreateDocumentStore())
     {
         using (var session = store.OpenSession())
         {
             var targets = TargetIntId.GenerateRandomData(100);
             session.InsertObjects(targets);
             session.SaveChanges();
         }
     }
 }
Example #3
0
        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));
        }
Example #4
0
        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()));
        }