I suspect that the following caused the exception:
I have a RavenDB server hosted by IIS. That's one instance.
For unit tests I create an embedded in-memory instance of RavenDB
(which is VERY convenient).
From what I saw in the source code, by default raven assigns a hard-
coded guid for the ResourceManagerId property (which then used by the
DTC). So the IIS and embedded server both try to register with the
same ResourceManagerId (the hardcoded one).
I've changed this Id to be automatically generated on IDocumentStorage
creation and everything now works fine.
Predictable :)
The ResourceManagerId issue even mentioned somewhere in the
documentation.