Export (0) Print
Expand All

OracleTransaction.Dispose Method

.NET Framework 1.1
Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Releases the unmanaged resources used by the OracleTransaction and optionally releases the managed resources.

[Visual Basic]
Public Overridable Sub Dispose() Implements IDisposable.Dispose
[C#]
public virtual void Dispose();
[C++]
public: virtual void Dispose();
[JScript]
public function Dispose();

Implements

IDisposable.Dispose

Remarks

This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize invokes Dispose with disposing set to false.

When the disposing parameter is true, this method releases all resources held by any managed objects that this OracleTransaction references. This method invokes the Dispose() method of each referenced object.

Notes to Inheritors:   Dispose can be called multiple times by other objects. When overriding Dispose(Boolean), be careful not to reference objects that have been previously disposed of in an earlier call to Dispose. For more information about how to implement Dispose(Boolean), see Implementing a Dispose Method.

For more information about Dispose and Finalize, see Cleaning Up Unmanaged Resources and Overriding the Finalize Method.

Example

[Visual Basic, C#, C++] The following example creates an OracleTransaction and then disposes of it.

[Visual Basic] 
Public Sub OracleTransactionHereAndGone()
    Dim myTransaction As OracleTransaction = myConnection.BeginTransaction()
    myTransaction.Dispose()
End Sub 'OracleTransactionHereAndGone

[C#] 
public void OracleTransactionHereAndGone()
{
    OracleTransaction myTransaction = myConnection.BeginTransaction();
    myTransaction.Dispose();
}

[C++] 
public:
    void OracleTransactionHereAndGone()
    {
        OracleTransaction* myTransaction = myConnection->BeginTransaction();
        myTransaction->Dispose();
    }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

OracleTransaction Class | OracleTransaction Members | System.Data.OracleClient Namespace

Show:
© 2014 Microsoft