BeginSessionlessTransaction

This method starts a new sessionless transaction and returns its global transaction identifier.

Declaration

// C#
public byte[] BeginSessionlessTransaction();

Return Value

A unique transaction identifier of the sessionless transaction.

Exceptions

InvalidOperationException - The connection is already associated with a transaction or is currently in a transaction.

OracleException - The database does not support sessionless transactions (ORA-26207).

Remarks

The unique transaction identifier is used to resume the transaction using the OracleConnection.ResumeSessionlessTransaction() method.

The sessionless transaction isolation level is based on the session's current isolation level. OracleConnection can operate on a sessionless transaction through its Commit(), Rollback(), SuspendSessionlessTransaction(), and ResumeSessionlessTransaction() methods.

Auto-commit is disabled when this method is invoked successfully.

If the OracleConnection.SessionlessTransactionOptions is set, then BeginSessionlessTransaction() operates the sessionless transaction based upon the OracleConnection.SessionlessTransactionOptions specified settings.

If the OracleConnection.SessionlessTransactionOptions is not set, then BeginSessionlessTransaction() operates the sessionless transaction using the following default behavior:

  • Sessionless transaction timeout is 60 seconds.

  • The connection is associated with the OracleConnection.BeginSessionlessTransaction() sessionless transaction. The transaction starts upon the first OracleCommand SQL execution.

  • The sessionless transaction will not be suspended implicitly after SQL execution.