If I am using a bulk insert operation to store a document, and then right after that using bulkInsert.DatabaseCommands,PutAttachment to put a related attachment into the database, in what order does that happen?I.e, does a bulkInsert DatabaseCommand get executed immediately, or are DatabaseCommands ALSO handled in bulk?
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
using(var bulkInsert = @this.BulkInsert(database, new BulkInsertOptions { CheckForUpdates = true })) {
bulkInsert.Store(document, DocumentType + "/" + document.Id);
bulkInsert.DatabaseCommands.PutAttachment(attId, null, data, RavenJObject.FromObject(new FileMetadata { FileName = string.Format("{0}.{1}", document.Name, document.FileType.ToLower().TrimStart('.')), MimeType = Constants.MimeTypes[document.FileType.ToLower()], Disposition = "inline", LastModified = DateTime.Now })); }
If it DOES work where they are put into the batch execution along with the other commands, it could help point in me in the right direction to ask another question, specifically, what would make a bulk insert seemingly timeout when pushing a couple hundred megs of attachments through DatabaseCommands.PutAttachment?
None of which worked unfortunately.
We tried upping the max request length to 2 gigs and our current timeout is 1200 seconds (20 minutes) on the raven server. Were also tried seeing the json timeout on the docstore as we found an older topic that made a suggestion for that.
None of which worked unfortunately.
--
using(var bulkInsert = @this.BulkInsert(database, new BulkInsertOptions { CheckForUpdates = true })) {
bulkInsert.Store(document, DocumentType + "/" + document.Id);
bulkInsert.DatabaseCommands.PutAttachment(attId, null, data, RavenJObject.FromObject(new FileMetadata { FileName = string.Format("{0}.{1}", document.Name, document.FileType.ToLower().TrimStart('.')), MimeType = Constants.MimeTypes[document.FileType.ToLower()], Disposition = "inline", LastModified = DateTime.Now })); }
System.Net.WebException: The request was aborted: The request was canceled. at System.Net.HttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state) at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl(Func`3 beginMethod, Func`2 endFunction, Action`1 endAction, Object state, TaskCreationOptions creationOptions) at System.Threading.Tasks.TaskFactory`1.FromAsync(Func`3 beginMethod, Func`2 endMethod, Object state) at System.Net.WebRequest.<GetResponseAsync>b__8() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Raven.Client.Connection.HttpJsonRequest.<RawExecuteRequestAsync>d__4b.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Raven.Client.Document.RemoteBulkInsertOperation.<DisposeAsync>d__18.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Raven.Client.Document.RemoteBulkInsertOperation.Dispose() at Raven.Client.Document.BulkInsertOperation.Dispose()