CommitFailureHandler Class

Entity Framework 6.0
 

Represents a transaction handler that allows graceful recovery from connection failures during transaction commit by storing transaction tracing information in the database. It needs to be registered by using SetDefaultTransactionHandler.

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

System.Object
  System.Data.Entity.Infrastructure.TransactionHandler
    System.Data.Entity.Infrastructure.CommitFailureHandler

public class CommitFailureHandler : TransactionHandler

NameDescription
System_CAPS_pubmethodCommitFailureHandler()

Initializes a new instance of the CommitFailureHandler class using the default TransactionContext.

System_CAPS_pubmethodCommitFailureHandler(Func<DbConnection, TransactionContext>)

Initializes a new instance of the CommitFailureHandler class.

NameDescription
System_CAPS_pubpropertyConnection

Gets the connection for which the transaction operations will be handled.(Inherited from TransactionHandler.)

System_CAPS_pubpropertyDbContext

Gets the context for which the transaction operations will be handled.(Inherited from TransactionHandler.)

System_CAPS_protpropertyIsDisposed

Gets or sets a value indicating whether this transaction handler is disposed.(Inherited from TransactionHandler.)

System_CAPS_pubpropertyObjectContext

Gets the context for which the transaction operations will be handled.(Inherited from TransactionHandler.)

System_CAPS_protpropertyPruningLimit

Gets the number of transactions to be executed on the context before the transaction log will be cleaned. The default value is 20.

System_CAPS_protpropertyTransactionContext

Gets the transaction context.

NameDescription
System_CAPS_pubmethodBeganTransaction(DbConnection, BeginTransactionInterceptionContext)

Stores the tracking information for the new transaction to the database in the same transaction.(Overrides TransactionHandler.BeganTransaction(DbConnection, BeginTransactionInterceptionContext).)

System_CAPS_pubmethodBeginningTransaction(DbConnection, BeginTransactionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodBuildDatabaseInitializationScript()

Builds the database initialization script.(Overrides TransactionHandler.BuildDatabaseInitializationScript().)

System_CAPS_pubmethodClearTransactionHistory()

Removes all the transaction history.

System_CAPS_pubmethodClearTransactionHistoryAsync()

Asynchronously removes all the transaction history.

System_CAPS_pubmethodClearTransactionHistoryAsync(CancellationToken)

Asynchronously removes all the transaction history.

System_CAPS_pubmethodClosed(DbConnection, DbConnectionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodClosing(DbConnection, DbConnectionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodCommitted(DbTransaction, DbTransactionInterceptionContext)

If there was an exception thrown checks the database for this transaction and rethrows it if not found. Otherwise marks the commit as succeeded and queues the transaction information to be deleted.(Overrides TransactionHandler.Committed(DbTransaction, DbTransactionInterceptionContext).)

System_CAPS_pubmethodCommitting(DbTransaction, DbTransactionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionGetting(DbTransaction, DbTransactionInterceptionContext<DbConnection>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionGot(DbTransaction, DbTransactionInterceptionContext<DbConnection>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionStringGetting(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionStringGot(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionStringSet(DbConnection, DbConnectionPropertyInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionStringSetting(DbConnection, DbConnectionPropertyInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionTimeoutGetting(DbConnection, DbConnectionInterceptionContext<Int32>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodConnectionTimeoutGot(DbConnection, DbConnectionInterceptionContext<Int32>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDatabaseGetting(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDatabaseGot(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDataSourceGetting(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDataSourceGot(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDispose()

Releases the resources used by this transaction handler.(Inherited from TransactionHandler.)

System_CAPS_protmethodDispose(Boolean)

Releases the resources used by this transaction object.(Overrides TransactionHandler.Dispose(Boolean).)

System_CAPS_pubmethodDisposed(DbConnection, DbConnectionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDisposed(DbTransaction, DbTransactionInterceptionContext)

Stops tracking the transaction that was disposed.(Overrides TransactionHandler.Disposed(DbTransaction, DbTransactionInterceptionContext).)

System_CAPS_pubmethodDisposing(DbConnection, DbConnectionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodDisposing(DbTransaction, DbTransactionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodEnlistedTransaction(DbConnection, EnlistTransactionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodEnlistingTransaction(DbConnection, EnlistTransactionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticFromContext(DbContext)

Gets the CommitFailureHandler associated with the context if there is one; otherwise returns null.

System_CAPS_pubmethodSystem_CAPS_staticFromContext(ObjectContext)

Gets the CommitFailureHandler associated with the context if there is one; otherwise returns null.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInitialize(DbContext, DbConnection)

Initializes the properties of the instance.(Overrides TransactionHandler.Initialize(DbContext, DbConnection).)

System_CAPS_pubmethodInitialize(ObjectContext)

Initializes the properties of the instance.(Overrides TransactionHandler.Initialize(ObjectContext).)

System_CAPS_pubmethodIsolationLevelGetting(DbTransaction, DbTransactionInterceptionContext<IsolationLevel>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodIsolationLevelGot(DbTransaction, DbTransactionInterceptionContext<IsolationLevel>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_protmethodMarkTransactionForPruning(TransactionRow)

Adds the specified transaction to the list of transactions that can be removed from the database

System_CAPS_protmethodMatchesParentContext(DbConnection, DbInterceptionContext)

Checks whether the supplied interception context contains the target context or the supplied connection is the same as the one used by the target context.(Inherited from TransactionHandler.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodOpened(DbConnection, DbConnectionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodOpening(DbConnection, DbConnectionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodPruneTransactionHistory()

Removes the transactions marked for deletion.

System_CAPS_protmethodPruneTransactionHistory(Boolean, Boolean)

Removes the transactions marked for deletion if their number exceeds PruningLimit.

System_CAPS_pubmethodPruneTransactionHistoryAsync()

Asynchronously removes the transactions marked for deletion.

System_CAPS_protmethodPruneTransactionHistoryAsync(Boolean, Boolean, CancellationToken)

Removes the transactions marked for deletion if their number exceeds PruningLimit.

System_CAPS_pubmethodPruneTransactionHistoryAsync(CancellationToken)

Asynchronously removes the transactions marked for deletion.

System_CAPS_pubmethodRolledBack(DbTransaction, DbTransactionInterceptionContext)

Stops tracking the transaction that was rolled back.(Overrides TransactionHandler.RolledBack(DbTransaction, DbTransactionInterceptionContext).)

System_CAPS_pubmethodRollingBack(DbTransaction, DbTransactionInterceptionContext)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodServerVersionGetting(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodServerVersionGot(DbConnection, DbConnectionInterceptionContext<String>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodStateGetting(DbConnection, DbConnectionInterceptionContext<ConnectionState>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodStateGot(DbConnection, DbConnectionInterceptionContext<ConnectionState>)

Can be implemented in a derived class.(Inherited from TransactionHandler.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

This transaction handler uses TransactionContext to store the transaction information the schema used can be configured by creating a class derived from TransactionContext that overrides OnModelCreating and passing it to the constructor of this class.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: