Details
-
Bug
-
Status: Closed
-
Minor - P4
-
Resolution: Won't Fix
-
1.11, 2.2.3
-
None
-
None
Description
If I have a main MongoClient that contains files I want to move from one server to another MongoClient (different connectionstring)
I get "InvalidOperationException: A nested call to RequestStart was made that is not compatible with the existing request."
Example code to reproduce the problem:
var guiDb = new MongoClient("mongodb://server1:27017/GridFSTest").GetServer().GetDatabase("GridFSTest");
|
var fs = guiDb.GetGridFS(new MongoGridFSSettings() { Root = "TestArea" });
|
var allFiles = fs.FindAll().ToList();
|
|
var server = new MongoClient("mongodb://server2:27017/GridFSTestTracker").GetServer().GetDatabase("GridFSTest");
|
|
var gridfs = server.GetGridFS(new MongoGridFSSettings()
|
{
|
Root = "TestArea"
|
});
|
|
foreach (var file in allFiles)
|
{
|
gridfs.Upload(file.OpenRead(), file.Name, new MongoGridFSCreateOptions { Id = file.Id, ContentType = file.ContentType, UploadDate = DateTime.Now, Metadata = file.Metadata }); // This row throws the exception
|
}
|