Embedded RavenFS

230 views
Skip to first unread message

Tobi

unread,
Sep 30, 2014, 10:52:23 AM9/30/14
to rav...@googlegroups.com
I still don't get it - how do I get a FilesStore from:

using (var docStore = new EmbeddableDocumentStore())
{
docStore.UseEmbeddedHttpServer = true;
docStore.Initialize();

// ???
}

???

Tobias

Oren Eini (Ayende Rahien)

unread,
Sep 30, 2014, 11:41:55 AM9/30/14
to ravendb
If you want to use RavenFS, you have to use RavenDbServer directly.
Then you have DocumentStore and FileStore properties that you use there.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 




--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Davis

unread,
Sep 30, 2014, 11:42:19 AM9/30/14
to rav...@googlegroups.com
I think you need to use the RavenDbServer class directly instead of the EmbeddableDocumentStore.  Here's a simplified version of how I'm doing it:

            var configuration = new RavenConfiguration
                                {
                                    DataDirectory = "path to the system DB"
                                };

            _server = new RavenDbServer(configuration);
            _server.UseEmbeddedHttpServer = true;

            _documentStore = _server.DocumentStore;
            // Insert code to configure things like conventions on the document store here

            _filesStore = _server.FilesStore;

            _server.Initialize();
          
            // Insert code to create the application DB if necessary here
            _documentStore.DefaultDatabase = "name of the application DB";
          
            // Insert code to create the application FS if necessary here
            _filesStore.DefaultFileSystem = "name of the application FS";



Tobi

unread,
Oct 1, 2014, 6:31:30 AM10/1/14
to rav...@googlegroups.com
Ok, thanks.

I'm trying to roll my own "EmbeddedRavenDB" class now. See:

https://gist.github.com/e-tobi/8fff5b6860e7b24db909

This seems to work from the client-side API, but the RavenDB-Studio does
not work.

When opening the application DB there, I get:

Failed to read collections Could not open database named: ApplicationDB

Der Zugriff auf den Pfad
"C:\Users\tobias\sandbox\ravendb\Raven.Tryouts\bin\Debug\Data\ApplicationDB\scratch.0000000000.buffers"
wurde verweigert.

(= access denied to scratch.0000000000.buffers)

Opening the file system in the studio I don't see the file I just
successfully created and queried from the client API.

Besides this I get this message multiple times:

~SigGenerator: Disposing esent resources from finalizer! You should call
Dispose
() instead!

Tobias
> an email to ravendb+unsubscribe@__googlegroups.com
> <mailto:ravendb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/__optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "RavenDB - 2nd generation document database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ravendb+u...@googlegroups.com
> <mailto:ravendb+u...@googlegroups.com>.

Oren Eini (Ayende Rahien)

unread,
Oct 1, 2014, 8:09:54 AM10/1/14
to ravendb

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Arkadiusz Paliński

unread,
Oct 2, 2014, 3:47:40 AM10/2/14
to rav...@googlegroups.com
Tobi,

your implementation is incorrect because you are creating a new OwinHttpServer while is's alredy created during ravenDbServer.Initialize(); The only thing you need is to set UseEmbeddedHttpServer = true when you create RavenDBServer instance. See here:

Tobi

unread,
Oct 6, 2014, 5:10:43 AM10/6/14
to rav...@googlegroups.com
Just to finish this thread: Arkadiusz added EnableHttpServer() and
DisableHttpServer() to RavenDBSserver. This way, the embedded http server
can be switched on/off even AFTER the RadenDBServer was initialized.

Arkadiusz: Works fine, thanks!

Tobias
> <javascript:>
> > <mailto:lista...@e-tobi.net <javascript:>>> wrote:
> >
> > I still don't get it - how do I get a FilesStore from:
> >
> > using (var docStore = new EmbeddableDocumentStore())
> > {
> > docStore.UseEmbeddedHttpServer = true;
> > docStore.Initialize();
> >
> > // ???
> > }
> >
> > ???
> >
> > Tobias
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "RavenDB - 2nd generation document database" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send
> > an email to ravendb+unsubscribe@__googlegroups.com
> <http://googlegroups.com>
> > <mailto:ravendb%2B...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/__optout
> <https://groups.google.com/d/__optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "RavenDB - 2nd generation document database" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send an
> > email to ravendb+u...@googlegroups.com <javascript:>
> > <mailto:ravendb+u...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout

Chris Marisic

unread,
Oct 7, 2014, 1:17:44 PM10/7/14
to rav...@googlegroups.com
With the assumption EnableHttpServer would be invoked from a [DEBUG THE RAVENS] button on an administrator control panel?

Tobi

unread,
Oct 7, 2014, 1:52:41 PM10/7/14
to rav...@googlegroups.com
Exactly. In the OEM/embedded use case, I really need the RavenDB Studio
only for maintenance and on my development machine.

I think in the 4 years I'm using RavenDb I only had to start the RavenDB
Studio once on a customer machine.

Tobias
Reply all
Reply to author
Forward
0 new messages