문제

I tried using CloudTable::ExecuteBatch(new TableBatchOperation{operation1, operation2}); Each operation was a Retrieve operation. The snippet in question looked like this:

var partitionKey = "1";

var operation1 = TableOperation.Retrieve(partitionKey, "1");
var operation2 = TableOperation.Retrieve(partitionKey, "2");

var executedResult = ExecuteBatch(new TableBatchOperation{operation1, operation2});

I got an exception saying there could not be any retrieve operations in a batch execution. Is there a way to pull this off or is an asynchronous execution the best way to handle multiple partition key, row key look ups? For my use case I will have to look up at most 3 different rows by partition key and row key at the same time.

도움이 되었습니까?

해결책

Yes, batch operations have certain restrictions and do not include GETS. You can try range queries as outlined here, if the partition key remains the same.

Windows Azure table access latency Partition keys and row keys selection

Otherwise, you can query in parallel.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top