Azure 存储相关 API 是否参与 System.Transactions? [英] Do Azure storage-related APIs participate in System.Transactions?

查看:26
本文介绍了Azure 存储相关 API 是否参与 System.Transactions?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在任何地方都找不到这方面的任何信息,但问题很简单.

I can't find any information on this anywhere and yet the question is simple.

我可以将与存储相关的操作包装在 TransactionScope 中,例如如果有回滚,上传的文件也会回滚吗?

Can I wrap storage-related actions in a TransactionScope such that e.g. if there is a rollback, the uploaded file is rolled back also?

如果原生 API 还没有这样做,那么是否有任何地方的公共实现?

If the native APIs don't do this already, is there a public implementation anywhere?

推荐答案

如果您指的是 Table 或 Blob 更新,则没有显式提交或回滚的概念.当您进行 API 调用(无论是直接 REST 调用还是通过 PowerShell/CLI/SDK)时,它只是针对存储的操作,它要么成功要么失败(尽管某些操作需要一段时间并且调用可能会在完成之前返回).没有包含此操作的事务范围.您需要注意在应用级别撤消 Table/Blob 更新.

If you're referring to Table or Blob updates, there's no notion of explicit commit or rollback. When you make an API call (whether direct REST call or via PowerShell / CLI / SDK), it's just an action against storage, and it will either succeed or fail (although some actions take a while and the call may return before completion). There's no transaction scope wrapping this action. You'd need to take care of undoing your Table / Blob updates at an app level.

这篇关于Azure 存储相关 API 是否参与 System.Transactions?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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