public void Commit(Guid txId)
{
try
{
lock (putSerialLock)
{
TransactionalStorage.Batch(actions =>
{
actions.Transactions.CompleteTransaction(txId, doc =>
{
// doc.Etag - represent the _modified_ document etag, and we already
// checked etags on previous PUT/DELETE, so we don't pass it here
if (doc.Delete)
Delete(doc.Key, null, null);
else
Put(doc.Key, null,
doc.Data,
doc.Metadata, null);
});
actions.Attachments.DeleteAttachment("transactions/recoveryInformation/" + txId, null);
workContext.ShouldNotifyAboutWork();
});
}
TryCompletePromotedTransaction(txId);
}
catch (Exception e)
{
if (TransactionalStorage.HandleException(e))
return;
throw;
}
}