10

Azure Table Storage へのバッチ挿入を実行しようとすると、次のようになりStorageExceptionますCloudTable.ExecuteBatch()

TableBatchOperation batchOperation = new TableBatchOperation();

foreach (var entity in entities)
{
    batchOperation.InsertOrReplace(entity);
}

table.ExecuteBatch(batchOperation);

スローされた例外:

Microsoft.WindowsAzure.Storage.StorageException: 操作の予期しない応答コード: 6 at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase1 cmd, IRetryPolicy policy, OperationContext operationContext) in e:\projects\azure- sdk-for-net\microsoft-azure-api\Services\Storage\Lib\DotNetCommon\Core\Executor\Executor.cs: Microsoft.WindowsAzure.Storage.Table.TableBatchOperation.Execute(CloudTableClient client, String tableName, TableRequestOptions の 737 行目) Microsoft.WindowsAzure.Storage.Table の e:\projects\azure-sdk-for-net\microsoft-azure-api\Services\Storage\Lib\DotNetCommon\Table\TableBatchOperation.cs:line 85 の requestOptions、OperationContext operationContext)。 CloudTable.ExecuteBatch(TableBatchOperation バッチ、TableRequestOptions requestOptions、OperationContext operationContext) in e:\projects\azure-sdk-for-net\microsoft-azure-api\Services\Storage\Lib\DotNetCommon\Table\CloudTable.cs:line 165 at Library.Modules.Cloud.TableStorage.StorageTableRepository1.InsertOrReplaceBatch(List1 エンティティ)

通常使用してこれらのエンティティを挿入しTableOperationても問題はありません。

この例外は、インターネット上または MSDN リファレンスのどこにも見つかりません。

4

1 に答える 1

15

重複RowKey値が原因でした。であってもTableBatchOperation.InsertOrReplace(entities)、行キーは一意である必要があります。

Unexpected response code for operation : 6リストの6番目の要素を参照していました。私の意見では、Azure SDK のエラー コードは非常に誤解を招くものです。

于 2013-11-15T08:00:07.090 に答える