1

現在、RavenDB (3.0) を試しており、一括挿入機能を使用しようとしています。ただし、一括挿入は機能しているように見えますが、終了直後に例外が発生し続けます。

An exception of type 'System.IO.EndOfStreamException' occurred in Raven.Client.Lightweight.dll but was not handled in user code

Additional information: Attempted to read past the end of the stream.

スタックトレースは

   at Raven.Client.Connection.ObservableLineStream.<Start>b__1(Task`1 task) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\ObservableLineStream.cs:line 39
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

これは私が持っているコードです:

 static void Main(string[] args)
 {
     try
     {
        using (var store = new DocumentStore {
                     Url = "http://localhost:8080/", 
                     DefaultDatabase = "Northwind" })
         {
             store.Initialize();
             int total = 10000;
             using (var bulkInsert = store.BulkInsert())
             {
                for (int i = 0; i < total; i++){
                     bulkInsert.Store(new Employee{
                             FirstName = "FirstName #" + i,
                             LastName = "LastName #" + i});
                        }                           
                    }
                }
            }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     finally
     {
         Console.ReadLine();
     }
 }

奇妙なのは、データデータベースに書き込まれていることです (データベース ブラウザーで表示できます) が、例外がコードでキャッチされていないことtry/catchです。

なぜそれが起こっているのか、そしてもっと重要なことに、どうすればそれを防ぐことができるのか、私は困惑しています. 誰にもアイデアはありますか?

4

1 に答える 1