The OracleLogicalTransaction
class provides detailed information about the logical transaction status. Applications can conclusively determine the outcome of the running transaction during the last database outage, then act accordingly to commit, complete, or rollback the transaction.
System.Object
System.MarshalByRefObject
Oracle.DataAccess.Client.OracleLogicalTransaction
// C# public sealed class OracleLogicalTransaction
Provider | ODP.NET, Unmanaged Driver |
Assembly | Oracle.DataAccess.dll |
Namespace | Oracle.DataAccess.Client |
.NET Framework | 3.5, 4.0, 4.5 |
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
See Also:
OracleLogicalTransaction
members are listed in the following tables.
OracleLogicalTransaction Public Read-Only Properties
OracleLoigcalTransaction
public read-only properties are listed in Table 6-87
Table 6-87 OracleLogicalTransaction Public Read-Only Properties
Property | Description |
---|---|
Specifies if the transaction was committed or not |
|
Specifies if the transaction completed and that the information returned may be incomplete and/or not all expected work was completed |
|
Specifies the user ID that is associated with the connection from which this object was obtained from |
|
Specifies the data source, for example TNS alias, that is associated with the connection from which this object was obtained from |
OracleLogicalTransaction Private Properties
OracleLoigcalTransaction
private properties are listed in Table 6-88
Table 6-88 OracleLogicalTransaction Private Properties
Property | Description |
---|---|
|
Holds a reference to a "cloned" |
OracleLogicalTransaction Methods
OracleLoigcalTransaction
private properties are listed in Table 6-89
OracleLoigcalTransaction
public read-only properties are listed in Table 6-90
Table 6-90 OracleLogicalTransaction Public Read-Only Properties
Property | Description |
---|---|
Specifies if the transaction was committed or not |
|
Specifies if the transaction completed and that the information returned may be incomplete and/or not all expected work was completed |
|
Specifies the user ID that is associated with the connection from which this object was obtained from |
|
Specifies the datasource, for example TNS alias, that is associated with the connection from which this object was obtained from |
See Also:
This property specifies if the transaction was committed or not.
// C# public bool? Committed {get;}
bool
.
If GetOutcome()
is not called, the this property holds a null
value.
Once GetOutcome()
is called, then this property will hold either true
or false
.
Table 6-91 describes the possible outcomes of the Committed
and UserCallCompleted
properties.
Table 6-91 Outcome of OracleLogicalTransaction Committed and UserCallCompleted Properties
Committed Value | UserCallCompleted Value | Outcome |
---|---|---|
|
|
The call did not execute the commit. |
|
|
The call did execute the commit and there was no additional information to return and no more work to do if that call was a PL/SQL procedure. |
|
|
The transaction is committed, but the information returned may be incomplete and/or not all expected work was completed. Examples of incomplete information or incomplete work done include: the number of rows modified when using autocommit or commit on success, parameter and function results when calling PL/SQL procedures, or PL/SQL procedures with more work to do after the commit. In order to function correctly, .NET applications that use data returned from the commit must check the |
This property specifies if the transaction completed and that the information returned may be incomplete and/or not all expected work was completed.
// C# public bool? UserCallCompleted {get;}
bool
If GetOutcome()
is not called, the this property holds a null
value.
Once GetOutcome()
is called, then this property will hold either true
or false
.
Table 6-91 describes the possible outcomes of the Committed
and UserCallCompleted
properties.
This property specifies user ID that is associated with the connection from which this object was obtained form.
// C# public string UserId {get;}
The user ID as a string.
OracleLoigcalTransaction
private properties are listed in Table 6-92
OracleLoigcalTransaction
private properties are listed in Table 6-93
Table 6-93 OracleLogicalTransaction Methods
Property | Description |
---|---|
This method releases any resources or memory allocated by the object |
|
This method retrieves the transaction outcome from the database server. The method will determine whether the transaction committed and completed or not. |
This method releases any resources or memory allocated by the object
// C# public void Dispose();
IDisposable
The Dispose
method also closes the OracleLogicalTransaction
object.
The GetOutcome
method retrieves the transaction outcome from the database server. The method will determine whether the transaction committed and completed or not.
GetOutcome()
This method uses cloned OracleConnection
that the OracleLogicalTransaction
was obtained from.
The connection is opened with pooling=false
and thus the connection gets severed/closed/freed as soon as the outcome is forced.
Repeated calls will not incur server round-trip.
GetOutcome(string
userid
, string
password
, string
dataSource
)
This method uses cloned OracleConnection
that the OracleLogicalTransaction
was obtained from.
The connection gets severed/closed/freed as soon as the outcome is forced.
Repeated calls will not incur server round-trip.
Note:
Once one server round-trip is incurred for theGetOutcome()
invpcatopm
, the PL/SQL ForceOutcome
is never invoked again against the server for a given OracleLogicalTransaction
object.