删除Azure的斑点在一个事务中 [英] Deleting Azure blobs in one transaction

查看:128
本文介绍了删除Azure的斑点在一个事务中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个对应到五个SQL Azure数据库表项在5 Azure的斑点。实体框架可以让我在一个事务中删除5个数据库条目如在这里看到:<一href=\"http://stackoverflow.com/questions/13082443/multiple-savechanges-calls-in-entity-framework?lq=1\">Multiple的SaveChanges调用实体框架。我想在一个事务中删除五个斑点也。因此,要么没有或所有的斑点被删除。我该怎么做呢?我打算如果有任何斑点的删除失败回滚我的数据库事务,但到目前为止,我只能删除斑点一次。

I have five Azure blobs that correspond to five SQL azure database entries. Entity Framework allows me to delete the five database entries in one transaction e.g. see here: Multiple SaveChanges calls in entity framework. I want to delete the five blobs in one transaction also. So either none or all of the blobs are deleted. How do I do this? I intend to roll back my database transaction if any of the blob deletes fail, but so far I can only delete blobs one at a time.

推荐答案

每个REST调用Blob存储是独立的;没有交易各地的多个电话。

Each REST call to blob storage is independent; there are no transactions around multiple calls.

删除单个调用(事务)中的多个斑点是,如果所有的斑点都是相同的容器内唯一可能的途径。然后,您可以执行容器上的删除单呼,这也将删除该容器内的所有斑点。

The only possible way of deleting multiple blobs within a single call (transaction) would be if all of the blobs were within the same container. You could then execute a delete on the container in a single call, which would also delete all the blobs within that container.

请参阅这里 API文档和<一个href=\"https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.cloudblobcontainer.delete.aspx\"相对=nofollow>这里为.NET库调用。

See here for API documentation, and here for the .net library call.

这篇关于删除Azure的斑点在一个事务中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆