FIX: You receive the ObjectDisposedException exception when you refer to the Transaction.Current.TransactionInformation object

Article translations Article translations
Article ID: 960754 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

Consider the following scenario:
  • You install the .NET Framework 2.0 or a later version of the .NET Framework.
  • You have an application that connects to Microsoft SQL Server 2008 by using the .NET Framework Data Provider for SQL Server.
  • The application uses the TransactionScope object to start a transaction.
  • In the transaction, you open a connection and enable the connection pool, and then you close the connection.

    Note You can specify "Pooling=true" in the connection string to enable the connection pool. The default value is "true."
After the connection is closed, a time-out or an exception occurs. If you reference to the Transaction.Current.TransactionInformation object, you may receive the following error message:
System.ObjectDisposedException: Cannot access a disposed object
......

CAUSE

The transaction rolls back because of the time-out or the exception. This causes the transaction object to be disposed of. When you try to access the current transaction information, this triggers the ObjectDisposedException exception.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

You must have the .NET Framework 2.0 SP2 installed to apply this hotfix.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
Windows Vista, 32-bit versions
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.40442,933,76015-Jun-200910:15x86
System.data.oracleclient.dll2.0.50727.4044486,40015-Jun-200910:15x86
Windows Vista, x64-based version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.40442,933,76015-Jun-200910:15x86
System.data.dll2.0.50727.40443,008,51215-Jun-200910:23x64
System.data.oracleclient.dll2.0.50727.4044486,40015-Jun-200910:15x86
System.data.oracleclient.dll2.0.50727.4044502,27215-Jun-200910:23x64
Windows Vista, IA-64-based version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.40442,933,76015-Jun-200910:15x86
System.data.dll2.0.50727.40443,234,81615-Jun-200910:16IA-64
System.data.oracleclient.dll2.0.50727.4044486,40015-Jun-200910:15x86
System.data.oracleclient.dll2.0.50727.4044505,85615-Jun-200910:16IA-64
Windows 2000, Windows Server 2003, Windows XP, 32-bit version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.40202,933,76027-Feb-200921:05x86
System.data.oracleclient.dll2.0.50727.4020486,40027-Feb-200921:05x86
Windows 2000, Windows Server 2003, Windows XP, x64-based version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.40203,008,51227-Feb-200916:22x64
System.data.dll2.0.50727.40202,933,76027-Feb-200921:05x86
System.data.oracleclient.dll2.0.50727.4020502,27227-Feb-200916:18x64
System.data.oracleclient.dll2.0.50727.4020486,40027-Feb-200921:05x86
Windows 2000, Windows Server 2003, Windows XP, IA-64-based version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.40203,234,81627-Feb-200918:24IA-64
System.data.dll2.0.50727.40202,933,76027-Feb-200921:05x86
System.data.oracleclient.dll2.0.50727.4020505,85627-Feb-200918:29IA-64
System.data.oracleclient.dll2.0.50727.4020486,40027-Feb-200921:05x86

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

WORKAROUND

To work around this problem, refer the transaction information from the TransactionEventArgs class in the Transaction Completed Event Handler.

Properties

Article ID: 960754 - Last Review: August 14, 2009 - Revision: 2.0
APPLIES TO
  • Microsoft .NET Framework 2.0
  • Microsoft .NET Framework 3.5
Keywords: 
kbhotfixserver kbexpertiseadvanced kbqfe kbsurveynew KB960754

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com