Try OpenEdge Now
skip to main content
ProDataSets
Updating Data with ProDataSets : Tracking changes in the temp-tables of a ProDataSet : Comparison with change tracking in .NET
 

Comparison with change tracking in .NET

For comparison it is important to note that .NET supports row states and versions similar to these, with certain exceptions. This is the mapping between .NET states and versions, and the ProDataSet records and row states:
*Record states in .NET can be Added, Deleted, Detached, Modified, or Unchanged. These correspond to ROW-STATE values in ABL except for Detached. Detached means created but not yet in the DataTable. This is a state that can be supported in the AVM using transaction semantics. If you CREATE a temp-table record inside a transaction, then until that transaction ends that record is Detached; it has been created but it is not yet "officially" or "definitively" in the table. It can be backed out if the transaction fails or is otherwise undone.
*Records in DataTables in .NET also have a version, which is a qualifier on the record object (like an attribute reference). This can be Current, Default, Original, or Proposed.
*The Current version is like a record in the ProDataSet after-table. We have specifically decided to use the term (and keyword element) AFTER because CURRENT already has a very specific, and very different, meaning in ABL, namely in functions and statements such as GET CURRENT, FIND CURRENT, and so on, that normally refer to a database record buffer.
*The Original version is like a record in the ProDataSet before-table. Once again, we have decided to use the term and keyword BEFORE rather than "original" because in the AVM we create and maintain a separate, additional table for the before images of records. It is logical to think of this table as being created as a by-product of the actual temp-table containing the data as it is retrieved and viewed. Therefore, anyone referring to these objects is likely to think of what Microsoft calls the "current" records as the "original" table, not the other way around. Also, the word "before" complements "after," so if one term is going to be different from .NET both might as well be, and also it matches our use of the well-established term "before-image," which is precisely what the "before" table contains.
*The Default version is defined to be the Current version for an Added or Modified record, or the Original version for a Deleted record. This rather specialized identifier is not duplicated in ABL and provides no information that cannot be obtained otherwise.
*The Proposed version is one that exists, but has not yet been committed to the DataTable. This state is possible inside a BEGIN-EDIT/END-EDIT block, which is essentially like a transaction block in ABL. Like the Detached state, this can be represented using transaction semantics in ABL, as a record still within an unfinished transaction.