Hi,
When using DocumentStore.DatabaseCommands.Put in a transactionscope,
it seems like the transaction is never completed.
The following test gives this error:
Raven.Client.Exceptions.NonAuthoritativeInformationException: Document
TheDocuments/1 returned Non Authoritative Information (probably
modified by a transaction in progress) and
AllowNonAuthoritativeInformation is set to false
Here is the failing test. The problem is the same for both embedded
and regular DocumentStore:
https://gist.github.com/2498717
public class TheTest
{
[Fact]
public void transaction_can_commit_when_using_embedded_store()
{
using (var store = new EmbeddableDocumentStore
{
RunInMemory = true,
})
{
store.Initialize();
string id;
using (var session = store.OpenSession())
{
var document = new TheDocument();
session.Store(document);
session.SaveChanges();
id = document.Id;
}
using (var tx = new
TransactionScope(TransactionScopeOption.RequiresNew,
TimeSpan.FromMinutes(10)))
{
var jsonDocument = store.DatabaseCommands.Get(id);
var ravenJObject = jsonDocument.DataAsJson;
store.DatabaseCommands.Put(id, null, ravenJObject,
jsonDocument.Metadata);
tx.Complete();
}
using (var session = store.OpenSession())
{
session.Advanced.AllowNonAuthoritativeInformation =
false;
Assert.DoesNotThrow(() =>
session.Load<TheDocument>(id));
}
}
}
public class TheDocument
{
public string Id { get; set; }
public string TheProp { get; set; }
}
}
Can anyone help? :)
/Lars