Click or drag to resize

BcfTransaction Class

[This is preliminary documentation and is subject to change.]

Represents a transaction.
Inheritance Hierarchy
SystemObject
  CalculationWorks.BusinessModelBcfTransaction

Namespace:  CalculationWorks.BusinessModel
Assembly:  CalculationWorks.BusinessModel (in CalculationWorks.BusinessModel.dll) Version: 4.0.0-beta7
Syntax
public class BcfTransaction : IBcfTransactionData

The BcfTransaction type exposes the following members.

Constructors
  NameDescription
Protected methodCode exampleBcfTransaction
Creates a new instance. It is recommended to use BcfDataSetBeginTransaction to create a transaction. The constructor should only be used in CreateTransaction(BcfTransactionBuilder).
Top
Properties
  NameDescription
Public propertyDataSet
Gets the BcfDataSet the transaction belongs to.
Public propertyEnforceConstraints
Gets a value indicating whether unique-key, foreign-key and relation constraints will be enforced after each update or not.
Public propertyHasDirtyItems
Gets a value indicating whether this instance has outstanding calculations (computed value cells and rule cells).
Public propertyInfo
Gets or sets custom information about the BcfTransaction.
Public propertyIsAlive
Gets a value indicating whether this instance is in use; as active transaction or in undo or redo.
Public propertyIsCommitted
Gets a value indicating whether this instance is committed.
Public propertyIsCurrent
Gets a value indicating whether this instance is current.
Public propertyIsRolledBack
Gets a value indicating whether this instance is rolled back.
Public propertyIsSubTransaction
Gets a value indicating whether this instance is a sub transaction.
Public propertyItemCount
Number of transactions compensation items.
Public propertyMicroTransactionMode
Gets or sets the mode for micro-transactions.
Public propertyMustRollback
Gets a value indicating whether the transaction caused an invalid state and must be rolled back.
Public propertyName
Gets or sets the transaction name.
Public propertyRecalculateAllRules
Gets a value indicating whether all rules should be executed on next Compute(Boolean) (computeRules = true) independent of cell state evaluation.
Public propertyRecalculateAllValues
Gets a value indicating whether all calculations should be executed on next Compute(Boolean) independent of cell state evaluation.
Public propertyTriggersEnabled
Gets or sets a value indicating whether triggers are enabled.
Top
Methods
  NameDescription
Public methodAcceptValuesAsResults
Causes the transaction to drop the list of computed cells needing re-calculation.
Protected methodCode exampleAdd
Adds the item to the transactions compensation repository.
Public methodBeginSubTransaction(BcfTransactionBuilder)
Creates and returns a sub transaction.
Public methodBeginSubTransaction(String, NullableBoolean)
Creates and returns a sub transaction.
Public methodCommit
Commits all changes made in this transaction.
Public methodCompute
Executes all necessary operations to bring the BcfCell.Values up to date.
Public methodCreateChangeSet
Creates a BcfChangeSet containing changes of this transaction (committed sub-transactions inclusive).
Public methodCurrentCompensationItems
Creates an array of current compensation items.
Public methodCode exampleEnterDumbMode

Sets all computed cells and faults to 'must recompute' and disables observing data until next call of Compute(Boolean) (implicit when main-transaction commits).

Call EnterDumbMode when load data into an empty BcfDataSet to speed up loading or if you want to force complete recalculation.

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 the default hash function.
(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 methodCode exampleOnBeforeCommitComplete
If using file-based undo here is the last chance for updates on Info before it is serialized.
Protected methodOnCommit
Protected methodCode exampleOnCommitComplete
Called when Commit executes. If using file-based undo the transaction is now persisted.
Protected methodCode exampleOnDiscard
Called when the transaction goes out of scope.
Protected methodCode exampleOnRollback
Called when a rollback will be performed.
Protected methodCode exampleOnRollbackComplete
Called after rollback was executed.
Public methodRollback
Discards the transaction and restores the data from state before the transaction started.
Public methodSetEnforceConstraints
Sets a value indicating whether constraints will be enforced or not.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
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. To improve performance and get a nice undo repository when more than one cell update is required, it is recommended to use transactions explicit.

See Also