8

How do I disable RavenDB replication? The reason for that is I have a simple database on one server and I don't need any replication at this point.

IDocumentStore tmpStore = new DocumentStore
{
    Url = url
};

tmpStore.Initialize();
tmpStore.DatabaseCommands.EnsureDatabaseExists(dbName); // WebException

If I try to ensure that database was created I get a WebException with HTTP status 404. This error occurred when RavenDB makes request to /docs/Raven/Replication/Destinations. Or shall I just ignore this exception?

oleksii
  • 35,458
  • 16
  • 93
  • 163

2 Answers2

5

The web exception is thrown and caught internally inside RavenDB Client. You can safely continue working, and your code will execute properly.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • 2
    Thanks Oren. But see, if I select Debug > Exceptions. And then break on the thrown exception, I will be stopped by inner exception in the internal library of Raven DB. Do you think you could perhaps reconsider throwing exception there? Is it really an exceptional situation? Or maybe I can disable that behaviour in a config file? – oleksii May 10 '11 at 09:00
  • @Ayende : when this exception happens in the context of a transaction (i.e. NServiceBus.IHandlMessage), it fails the transaction. Does that make sens ? – VdesmedT Feb 15 '13 at 15:30
2

The 404 is caused by Raven checking to see if you have replication setup and you can safely ignore it.

http://groups.google.com/group/ravendb/browse_thread/thread/5cdde7854bc929f4

http://groups.google.com/group/ravendb/browse_thread/thread/6cb950e1eb760c08/c09ce446a3f4e99f

Adam Cooper
  • 8,077
  • 2
  • 33
  • 51
  • thanks for your answer. This is, however, is not the case. Even if I set the database connection string explicitly, it still throws inner exception as there is no replication configured. You should be able to see this behaviour if you switch Debug > Exceptions > CLR exceptions – oleksii May 03 '11 at 14:15
  • OK I see now, you can ignore the 404, I've updated my answer. – Adam Cooper May 03 '11 at 15:43
  • yeah I also saw that. I will ignore these exceptions. It is a little bit awkward though. – oleksii May 03 '11 at 15:54