azure table : Duplicate partition key results in (409) conflict

点点圈 提交于 2019-12-11 16:59:18

问题


I am trying to insert multiple rows into the Azure table service. As far as this article goes, I have understood the partition key to be able to store duplicates. However, while following this article, when I try to insert a duplicate partition key I get an error:

The remote server returned an error: (409) Conflict.

What could be wrong in my code? I am following it as per the second article; Or is my understanding incorrect? Also, the first article says that the row key is supposed to act as primary key. The second article says I can hardcode it for the example. This has me confused as to what is exactly correct. Both the articles are posted on credible sites. I am working on VS2013 with a trial account for azure. What am I missing?


回答1:


The Partition Key + the Row Key together act as a primary key for that entry into the table, this combination must be unique. You can have a virtually unlimited number of rowkeys within a single partition, as long as you don't violate the PK+RK=unique constraint.

Keep in mind however, that throughput scale targets for Azure table storage center around the partition. So the strategy you leverage to identify your partition key should be something that meets your needs for both scale and accessibility.



来源:https://stackoverflow.com/questions/48395464/tablelogger-cs-throwing-storageexception-409-conflict

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!