Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用System.Transactions时保存点的替代方法_C#_.net_Transactions_Transactionscope - Fatal编程技术网

C# 使用System.Transactions时保存点的替代方法

C# 使用System.Transactions时保存点的替代方法,c#,.net,transactions,transactionscope,C#,.net,Transactions,Transactionscope,如何使用System.Transactions命名空间中的类来实现与使用and时类似的效果。使用这两种方法的效果是能够在正在运行的事务中创建命名的保存点,并且在出现问题时仅回滚到保存点(在保存点之前创建的操作不会回滚)。保存点在其实现的一部分中是特定于数据库的。Oracle实现了它们,SQL server显然也实现了 System.Transactions专为全通径交易而设计,而不是交易过程中的中间保存点 唉,因为在支持的最低公分母数据库中使用此功能会很好:ACCESS JET。yourcont

如何使用
System.Transactions
命名空间中的类来实现与使用and时类似的效果。使用这两种方法的效果是能够在正在运行的事务中创建命名的保存点,并且在出现问题时仅回滚到保存点(在保存点之前创建的操作不会回滚)。

保存点在其实现的一部分中是特定于数据库的。Oracle实现了它们,SQL server显然也实现了

System.Transactions
专为全通径交易而设计,而不是交易过程中的中间保存点


唉,因为在支持的最低公分母数据库中使用此功能会很好:ACCESS JET。

yourcontext.database.ExecuteSqlCommand(string.Concat(“保存事务”,savePoint))


yourcontext.Database.ExecuteSqlCommand(string.Concat(“回滚事务”,savePoint))