如何检查SQL事务以及文件复制是否发生 [英] how to check if sql transaction as well as copying of file takes place for sure

查看:151
本文介绍了如何检查SQL事务以及文件复制是否发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确保我的交易以及垂直文件的复制都同时发生..或者它们不会发生


我怎么能做到这一点...

i want to make sure that my transaction as well as copying of a perticular file happen both simoultanously..or they dont happen


how can i achieve this...

推荐答案

您将需要为此使用Microsoft事务服务器(mts).使用它,您可以创建事务上下文,执行所有都需要调用SetComplete的多项操作(例如文件处理和数据库更新,也包括混合操作)(表明代码没有遇到任何问题).当您随后调用提交时,MTS将尝试提交所有操作.如果称为SetAbort或Commit的操作之一以某种方式失败,则完全回滚将确保没有任何更改.

请查看此链接以获取更多信息:
http://technet.microsoft.com/en-us/library/cc805563 [ ^ ]

祝你好运!
You''ll need microsoft transaction server (mts) for this. With it, you create a transaction context, execute multiple actions (like file handling and database updates, also mixed) that all need to call SetComplete (indicating the code didn''t encounter any problems). When you then call Commit, MTS will try to commit all the actions. If one of the actions called SetAbort or the Commit somehow fails, a full rollback will ensure nothing changed.

Check out this link for more info:
http://technet.microsoft.com/en-us/library/cc805563[^]

Good luck!


这篇关于如何检查SQL事务以及文件复制是否发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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