Permalink
Browse files

RavenDB-6039 ShardedBulkInsertOperation is using wrong DatabaseComman…

…ds for entityId generation when 'database' parameter is used
  • Loading branch information...
1 parent 492d657 commit fb3da469c254ce6b778aa265a61f2e5bb5350472 @ppekrol ppekrol committed with ayende Jan 11, 2017
Showing with 4 additions and 1 deletion.
  1. +4 −1 Raven.Client.Lightweight/Document/ShardedBulkInsertOperation.cs
@@ -61,7 +61,10 @@ public void Store(object entity)
Bulks.Add(shardId, bulkInsertOperation);
}
- DatabaseCommands = shard.AsyncDatabaseCommands;
+ DatabaseCommands = string.IsNullOrWhiteSpace(database)
+ ? shard.AsyncDatabaseCommands
+ : shard.AsyncDatabaseCommands.ForDatabase(database);
+
string id;
if (generateEntityIdOnTheClient.TryGetIdFromInstance(entity, out id) == false)
{

0 comments on commit fb3da46

Please sign in to comment.