DependentTransaction.Complete 方法


尝试完成从属事务。Attempts to complete the dependent transaction.

 void Complete();
public void Complete ();
member this.Complete : unit -> unit
override this.Complete : unit -> unit
Public Sub Complete ()


调用此方法后任何针对此事务进行额外工作的尝试。Any attempt for additional work on the transaction after this method is called. 这包括调用 EnlistVolatileEnlistDurableClone()DependentClone(DependentCloneOption) 等方法,或针对事务的任何序列化操作。These include invoking methods such as EnlistVolatile, EnlistDurable, Clone(), DependentClone(DependentCloneOption) , or any serialization operations on the transaction.


当依赖克隆要通知创建者已完成其工作的事务时,请调用此方法,并且如果父项也准备就绪,则可以提交事务。Call this method when the dependent clone wants to inform the creator of the transaction that it has finished its work, and the transaction can be committed if the parent is also ready.

调用此调用后,不应尝试对事务执行任何其他操作,否则会引发异常。After this call is invoked, you should not attempt any additional work on the transaction, or an exception is thrown.

如果在调用此方法后和事务完成之前,应用程序域出现故障,则事务可能会中止。If the application domain goes down after this method is called, and before the transaction is completed, the transaction might abort.

注意在依赖事务的生存期内,只应调用一次此方法。Note This method should be called only once during the dependent transaction's lifetime.