vb.net - Fetching Records from multiple tenant in RavenDB -


i using embeddabledocumentstore records stored in raven.

below vb.net code access raven data

dim documentstore embeddabledocumentstore = new embeddabledocumentstore() documentstore.datadirectory = "d:\test\server1" documentstore.defaultdatabase = "testdb1" documentstore.url = "http://localhost:8585/" documentstore.initialize() dim session document.documentsession = documentstore.opensession() dim lineitems = session.query(of lineitem)() 

above code retrieves records database testdb1, have testdb2 database

now have 2 question

  1. how access records server1.testdb1.lineitem , server1.testdb2.lineitem

  2. how access records server1.testdb1.lineitem , server2.testdb1.lineitem

a few things:

  • you should opening session within using statment.

  • when so, can pass database name parameter opensession method.

  • if regularly working multiple databases, should pass database name every time open session, instead of assigning default database.

  • an embeddabledocumentstore runs in context of process executing it, not connecting server. url used when using regular documentstore , connecting ravendb instance running elsewhere - in case datadirectory not used.

  • if using documentstore , connecting servers elsewhere, need 2 separate instances of documentstore - 1 server1 , server2.

  • however, doesn't make sense run 2 separate embeddabledocumentstore instances in same process. work, can't see advantage.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -