DbTransaction 類別

定義

定義資料庫交易的核心行為,並為資料庫相關交易提供基底類別。Defines the core behavior of database transactions and provides a base class for database-specific transactions.

public ref class DbTransaction abstract : MarshalByRefObject, IDisposable, System::Data::IDbTransaction
public abstract class DbTransaction : MarshalByRefObject, IDisposable, System.Data.IDbTransaction
type DbTransaction = class
    inherit MarshalByRefObject
    interface IDbTransaction
    interface IDisposable
Public MustInherit Class DbTransaction
Inherits MarshalByRefObject
Implements IDbTransaction, IDisposable
繼承
DbTransaction
衍生
實作

建構函式

DbTransaction()

初始化新的 DbTransaction 物件。Initializes a new DbTransaction object.

屬性

Connection

指定與交易關聯的 DbConnection 物件。Specifies the DbConnection object associated with the transaction.

DbConnection

當覆寫衍生類別時,取得交易相關聯的 DbConnection 物件。When overridden in a derived class, gets the DbConnection object associated with the transaction.

IsolationLevel

當覆寫衍生類別時,取得此交易的隔離等級。When overridden in a derived class, gets the isolation level for this transaction.

方法

Commit()

當覆寫衍生類別時,認可資料庫交易。When overridden in a derived class, commits the database transaction.

CommitAsync(CancellationToken)

非同步地認可資料庫交易。Asynchronously commits the database transaction.

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Dispose()

釋放由 DbTransaction 使用的 Unmanaged 資源。Releases the unmanaged resources used by the DbTransaction.

Dispose(Boolean)

釋放 DbTransaction 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the DbTransaction and optionally releases the managed resources.

DisposeAsync()

非同步地處置交易物件。Asynchronously diposes the transaction object.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
Rollback()

當覆寫衍生類別時,復原暫止狀態的交易。When overridden in a derived class, rolls back a transaction from a pending state.

RollbackAsync(CancellationToken)

非同步地復原暫止狀態的交易。Asynchronously rolls back a transaction from a pending state.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

IDbTransaction.Connection

取得與交易相關聯的 DbConnection 物件,如果交易已不再有效,則為 Null 參考。Gets the DbConnection object associated with the transaction, or a null reference if the transaction is no longer valid.

適用於

另請參閱