My first thought is to consider some unit of work pattern, but what I'm doing is pretty small and lightweight and I want to avoid overengineering my solution..
I would like to have a single transaction scope across more than one RavenDB database.. something like
class WidgetFacade
{
void SaveData (Widget widget, User user)
{
IDocumentStore documentStore = new DocumentStore { Url = "http://server:8080/" };
IDocumentSession session = documentStore.OpenSession("database1");
session.Store(user);
session = documentStore.OpenSession("database2");
session.Store(widget);
session.Savechanges();
session.Dispose();
}
}