Export (0) Print
Expand All

Enlistment.Done Method

Note: This method is new in the .NET Framework version 2.0.

Indicates that the transaction participant has completed its work.

Namespace: System.Transactions
Assembly: System.Transactions (in system.transactions.dll)

public void Done ()
public void Done ()
public function Done ()

During the final phase of the transaction commit, the transaction manager calls either the Commit, Rollback or InDoubt method of the participant, depending on whether the transaction is to be committed or rolled back. The resource manager should perform any work necessary to finish the transaction and then inform the transaction manager that it has finished by calling the Done method on the enlistment parameter.

If the resource manager has enlisted durably, but does not respond by calling Done method, the transaction manager is unsure that the resource manager has received the respective notification call. As such, the transaction manager keeps waiting for a response, and maintains information relevant to this transaction. If Done is never called, this piece of information is kept around indefinitely in memory or in a system-wide resource. This results in resources not being able to be reclaimed. In the case of a distributed transaction, this could eventually fill the MSDTC log which halts the MSDTC process. In the case of a transaction managed by System.Transactions, this results in a gradual and continual increase in the memory consumption of the resource manager's process. Therefore, it is crucial that you call the Done method once your resource manager is done with your prepare work.

An enlistment can call the Done method at anytime before it has called Prepared in the prepare phase. By doing so, the enlistment is casting a read only vote, meaning that it votes commit on the transaction but does not need to receive the final outcome. Note that, after this method is called, the enlisted participant receives no further notifications from the transaction manager.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft