I’m trying to use the batch option to save entities in an azure storage table
Here is the code :
foreach (TableEntity entity in entitiesList)
{
ServiceContext.AddObject(entity.getTableName(), entity);
}
ServiceContext.SaveChangesWithRetries(SaveChangesOptions.Batch);
I’m getting this Exception :
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>InvalidInput</code>
<message xml:lang="en-US">99:One of the request inputs is not valid.
RequestId:b54a78fe-30ae-427e-86e9-6107d6e3fe5a
Time:2013-01-14T15:50:17.0134794Z</message>
</error>
but when I try to to add each entity on a separate query it work’s
but what I don’t understand is that when I check the table on the azure sotage account with “Azure Storage Explorer”, I found the Data that I’m trying to load !!
Can anyone explain why I found the data on the azure table although I have an exception, and how to fix it, in order to use batch option with ServiceContext.SaveChangesWithRetries method
thank’s in advance for your help
The Batch option only supports adding up to 100 entities that have only one PartitionKey. Please ensure that you’re not saving more than 100 entities and that all contain one key.
Please find more information on Batch Entity transactions here:
http://msdn.microsoft.com/en-us/library/windowsazure/dd894038.aspx