2
votes

i want to use asp MVC with the Embedded RavenDB but it looks like that the DB don't react when debug the MVC application (using VS 2010 and IIS 7.5 Express). For Example in a MVC action i write an object an try to read it from the db in the next step, but the object is not found until the next request. For me it looks like the embedded RavenDB can only listen for request if the MVC application is on idle.

If i changed from embedded to the normal Client/Server it works without problems. I would prefer to use the embedded RavenDB. Maybe someone has some experience with this problem?!

5

5 Answers

2
votes

The in memory database takes time to do things, so you might be getting stale results.

The nostalequerieslistener from this question should help: RavenDB how to flush?

I had this issue with unit tests, bascially while RavenDB in memory is fast, the small amount of code between inserting and querying for the object is faster.

2
votes

You can use RavenDB embedded without any disadvantages, except that your application startup will take a little longer, when you create the EmbeddableDocumentStore, but nothing to worry about.

The only thing that you should keep in mind is that while you can seemlessly switch from embedded to client/server, there are (very few) cases where you can't go the other way without modifying your code. For example, the lazy-features aren't available in the embedded session because just don't make sense there.

2
votes

Easily you can integrate. this might help. http://msdn.microsoft.com/en-us/magazine/hh547101.aspx

Please mark as answer if solved your issue.

1
votes

RavenDB implement the Unit Of Work pattern. Do you call SaveChanges on the document session when you are done?

1
votes

Yep.

Check this post for a complete sample using best practices:

RavenDB, UnitOfWork and MVC - revisited