Click or drag to resize
CalculationWorks Logo
BcfTransaction Class
Represents a transaction.
Inheritance Hierarchy
SystemObject
  CalculationWorks.BusinessModelBcfTransaction

Namespace: CalculationWorks.BusinessModel
Assembly: CalculationWorks.BusinessModel (in CalculationWorks.BusinessModel.dll) Version: 2.1.0.0
Syntax
public class BcfTransaction

The BcfTransaction type exposes the following members.

Constructors
  NameDescription
Protected methodBcfTransaction

Initializes a new instance of the BcfTransaction class.

To begin a transaction use BcfDataSet.BeginTransaction.

To use custom transactions see BcfDataSetTransactionFactory and example Ignoring changes on spcific columns in HasChanges.

Top
Methods
  NameDescription
Protected methodAddItem
Adds the IBcfUndoRedoItem to the transactions compensation repository.
Protected methodAddItems
Adds the items to the transactions compensation repository.
Public methodBeginSubTransaction
Begins a sub transaction.
Public methodBeginSubTransaction(BcfTransactionBuilder)
Begins a sub transaction.
Public methodCommit
Commits all changes within this transaction.
Public methodCompute
Executes all necessary operations to bring the BcfCell.Values up to date. The validation tags will not be updated.
Public methodCompute(Boolean)
Executes all necessary operations to bring the BcfCell.Values up to date.
Public methodDropCompensationRepository
Drops the compensation repository.
Public methodEnforceRelationConstraints
Updates the internal indexes and throws ArgumentException if any foreign or unique key constraint is violated.
Public methodEnterDumbMode

Sets all computed cells and validations to 'must recompute' and disables the internal change tracking until next call of Compute (implicit by BeginSubTransaction or Commit) or Rollback. When DumbMode ends all computed cells and validations will be recomputed.

Very useful when loading data into an empty BcfDataSet.

Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnCommit
Called when committing.
Protected methodOnRollback
Called when rollback.
Protected methodRedo
Infrastructure. This method supports the infrastructure and is not intended to be used directly from your code.
Public methodRollback
Discards the transaction and restores the data from state before the transaction started.
Public methodRollback(Exception)
Discards the transaction and restores the data from state before the transaction started.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUndo
Infrastructure. This method supports the infrastructure and is not intended to be used directly from your code.
Top
Properties
  NameDescription
Public propertyAutoRollback
Protected propertyCompensationRepository
Gets the compensation repository.
Public propertyCompensationRepositoryDropped
Gets a value indicating whether compensation repository is dropped.
Public propertyDataSet
Gets the BcfDataSet the transaction belongs to.
Public propertyIsCommitted
Gets a value indicating whether this instance is committed.
Public propertyIsCurrent
Gets a value indicating whether this instance is current.
Public propertyIsDiscarded
Gets a value indicating whether this instance is discarded.
Public propertyIsSubTransaction
Gets a value indicating whether this instance is sub transaction.
Top
Remarks

Any update operation on a data object is wrapped in a transaction. Setting a value or adding a row will create a transaction, execute the operation and commit the transaction. Before every begin and end of any transaction or subtransaction the outstanding calculations and validations will be processed. To improve performance and get a nice undo repository when more than one cell update is required, it is recommended to use transactions explicit. Begin a try-block immediately after the transaction is created. The transaction commit should always be the last instruction inside the try-block. Rollback failed transactions.

Examples
See Also