Browse files

Resolving an issue where we set the properties on the patch object be…

…fore we commit the transaction
  • Loading branch information...
1 parent 4931a8d commit 6dc5de6d633d8e858422d03fcdd3e5b0adbd7b7c @ayende ayende committed Jan 28, 2014
Showing with 10 additions and 4 deletions.
  1. +10 −4 Raven.Database/Extensions/CommandExtensions.cs
View
14 Raven.Database/Extensions/CommandExtensions.cs
@@ -67,8 +67,11 @@ private static void Execute(ICommandData self, DocumentDatabase database, BatchR
var doc = database.Get(patchCommandData.Key, patchCommandData.TransactionInformation);
if (doc != null)
{
- patchCommandData.Metadata = doc.Metadata;
- patchCommandData.Etag = doc.Etag;
+ database.TransactionalStorage.ExecuteImmediatelyOrRegisterForSynchronization(() =>
+ {
+ patchCommandData.Metadata = doc.Metadata;
+ patchCommandData.Etag = doc.Etag;
+ });
}
return;
}
@@ -93,8 +96,11 @@ private static void Execute(ICommandData self, DocumentDatabase database, BatchR
var doc = database.Get(advPatchCommandData.Key, advPatchCommandData.TransactionInformation);
if (doc != null)
{
- advPatchCommandData.Metadata = doc.Metadata;
- advPatchCommandData.Etag = doc.Etag;
+ database.TransactionalStorage.ExecuteImmediatelyOrRegisterForSynchronization(() =>
+ {
+ advPatchCommandData.Metadata = doc.Metadata;
+ advPatchCommandData.Etag = doc.Etag;
+ });
}
return;
}

0 comments on commit 6dc5de6

Please sign in to comment.