Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Rollback Method
Collapse the table of content
Expand the table of content

IEnlistmentNotification.Rollback Method

Notifies an enlisted object that a transaction is being rolled back (aborted).

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

void Rollback(
	Enlistment enlistment
)

Parameters

enlistment
Type: System.Transactions.Enlistment

A Enlistment object used to send a response to the transaction manager.

The transaction manager calls this method of an enlisted object when the transaction is being rolled back (aborted) due to the inability of one or more transaction participants to commit the transaction.

The resource manager should perform any work necessary to finish the transaction and then inform the TM 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 Rollback 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft