OracleException Class

The OracleException class represents an exception that is thrown when the Oracle Data Provider for .NET encounters an error. Each OracleException object contains at least one OracleError object in the Error property that describes the error or warning.

Class Inheritance

System.Object

System.Exception

System.SystemException

System.Runtime.InteropServices.ExternalException

System.Data.Common.DbException

Oracle.DataAccess.Client.OracleException

Declaration

// C#
public sealed class OracleException : SystemException

Requirements

Provider

ODP.NET, Unmanaged Driver

ODP.NET, Managed Driver

Assembly

Oracle.DataAccess.dll

Oracle.ManagedDataAccess.dll

Namespace

Oracle.DataAccess.Client

Oracle.ManagedDataAccess.Client

.NET Framework

2.0, 3.0, 3.5, 4.0, 4.5

4.0, 4.5

Thread Safety

All public static methods are thread-safe, although instance methods do not guarantee thread safety.

Remarks

If there are multiple errors, ODP.NET only returns the first error message on the stack.

IsRecoverable

This property specifies whether the current operation producing this exception can succeed if retried.

Declaration

// C#
public bool IsRecoverable {get;}

Property Value

A bool.

Remarks

When a database outage occurs, such as during a network failure, the session becomes unavailable and the client receives an error code. The client can have difficulty determining whether the in-flight operation committed or needs to be resubmitted. Oracle automatically determines whether an in-flight database operation can be recovered or not using the IsRecoverable property. If IsRecoverable returns true after an outage, then the application can retrieve the current operation status and complete the transaction. If IsRecoverable returns false, then the application can rollback the current operation and resubmit the transaction.