[This is preliminary documentation and is subject to change.]
CalculationWorks.BusinessModelBcfTransaction
Namespace: CalculationWorks.BusinessModel
Assembly: CalculationWorks.BusinessModel (in CalculationWorks.BusinessModel.dll) Version: 1.1.0.0
The BcfTransaction type exposes the following members.
Name | Description | |
---|---|---|
BcfTransaction | Transaction infrastructure. Do not call this method. To begin a transaction use BcfDataSet.BeginTransaction. To begin a sub transaction use the current transactions BeginSubTransaction method. Initializes a new instance of the BcfTransaction class. |
Name | Description | |
---|---|---|
AddItem |
Adds the IBcfUndoRedoItem to the transactions compensation repository.
| |
BeginSubTransaction |
Begins a sub transaction.
| |
BeginSubTransaction(BcfTransactionBuilder) |
Begins a sub transaction.
| |
Commit |
Commits all changes within this transaction.
| |
Compute | ||
Compute(Boolean) | ||
EnforceRelationConstraints |
Updates the internal indexes and throws ArgumentException if any foreign or unique key constraint is violated.
| |
EnterDumbMode | 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. | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Redo |
Infrastructure. This method supports the infrastructure and is not intended to be used directly from your code.
| |
Rollback |
Discards the transaction and restores the data from state before the transaction started.
| |
Rollback(Exception) |
Discards the transaction and restores the data from state before the transaction started.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Undo |
Infrastructure. This method supports the infrastructure and is not intended to be used directly from your code.
|
Name | Description | |
---|---|---|
CompensationRepository |
Gets the compensation repository.
| |
DataSet |
Gets the BcfDataSet the transaction belongs to.
| |
IsCommitted |
Gets a value indicating whether this instance is committed.
| |
IsCurrent |
Gets a value indicating whether this instance is current.
| |
IsDiscarded |
Gets a value indicating whether this instance is discarded.
| |
IsSubTransaction |
Gets a value indicating whether this instance is sub transaction.
|
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.
try {
... do some data updates ...
transaction.Commit();
}
catch(BcfComputeException ex) {
transaction.Rollback(ex);
throw;
}