1

I use ravendb as embedded database in my winforms project. Everything works as it should but I do need to check with someone startup time of winform main window. When I'm added IDocumentStore initialization startup time is increased by 5,6 seconds.

inside MainForm.cs I have

private IDocumentStore store = new EmbeddableDocumentStore { 
            RunInMemory = false };

public MainForm()
{
   InitializeComponent();
   store.Initialize();
}

am I doing something wrong here with IDocumentStore instance ?

user2783193
  • 992
  • 1
  • 12
  • 37

2 Answers2

3

If you don't need to access the database right away, you might consider launching the application first, and then initializing it in a separate thread. You'd have to have some kind of "loading..." indicator in your UI, and a flag to check if the initialization is complete so you don't attempt to access the database before it is fully initialized.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
  • considering your advice I created question http://stackoverflow.com/questions/19587670/initializing-repository-in-separated-thread-issue – user2783193 Oct 25 '13 at 10:49
2

No, this an Embedded instance and it takes RavenDB a few seconds to initialize the store, that is expected.

synhershko
  • 4,472
  • 1
  • 30
  • 37